Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support getShort for DATA_TYPE in TypeInfo #1691

Merged
merged 3 commits into from
Aug 6, 2024

Commits on Jul 25, 2024

  1. fix: support getShort for DATA_TYPE in TypeInfo

    The ResultSet that is returned by DatabaseMetadata#getTypeInfo has
    a column at index 2 with the name DATA_TYPE. This field should
    contain one of the java.sql.Types constants, or a vendor-specific
    type code. The JDBC specification states that this column should
    be a `short` (although the constants in java.sql.Types are of
    type `int`).
    Cloud Spanner (at the time of writing) does not support any int16
    fields. The type code is therefore returned as an int64. The codes
    that are used for vendor-specific types by Spanner exceed the max
    value of a `short`, and therefore resulted in an OUT_OF_RANGE
    exception if you tried to call `ResultSet#getShort(int)` on
    this column for any of the Spanner-specific types (e.g. JSON).
    
    This change fixes that by adding an additional vendor type code
    for these types that does fit in a `short`. This value is
    returned when `getShort(int)` is called on the ResultSet.
    
    Fixes #1688
    olavloite committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    d0cade2 View commit details
    Browse the repository at this point in the history
  2. chore: cleanup

    olavloite committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    3ad35f0 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. Configuration menu
    Copy the full SHA
    a9da755 View commit details
    Browse the repository at this point in the history