-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
api: spannerIssues related to the googleapis/java-spanner-jdbc API.Issues related to the googleapis/java-spanner-jdbc API.
Description
Seems like a straightforward bug. BIT seems otherwise supported. Types.BOOLEAN works fine.
According to the spanner docs:
For nullable data types, NULL is a valid value. Currently, all existing data types are nullable.
so I'd expect BIT to be nullable too.
Steps to reproduce
- Set a null parameter in SQL which ends up evaluating to BIT type. The corresponding database column will be nullable BOOL.
- IllegalArgumentException at runtime
Stack trace
java.lang.IllegalArgumentException: Unsupported sql type for setting to null: -7
com.google.cloud.spanner.jdbc.JdbcParameterStore.setNullValue(JdbcParameterStore.java:912)
at com.google.cloud.spanner.jdbc.JdbcParameterStore.setSingleValue(JdbcParameterStore.java:415)
at com.google.cloud.spanner.jdbc.JdbcParameterStore.setValue(JdbcParameterStore.java:402)
at com.google.cloud.spanner.jdbc.JdbcParameterStore.bindParameterValue(JdbcParameterStore.java:384)
at com.google.cloud.spanner.jdbc.JdbcPreparedStatement.createStatement(JdbcPreparedStatement.java:61)
at com.google.cloud.spanner.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:80)
External references such as API reference guides
https://cloud.google.com/spanner/docs/reference/standard-sql/data-types for the "all existing data types are nullable"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the googleapis/java-spanner-jdbc API.Issues related to the googleapis/java-spanner-jdbc API.