This repository was archived by the owner on Apr 7, 2026. It is now read-only.
fix: untyped null parameters would cause NPE#1680
Merged
Conversation
Adding an untyped null value as a parameter to a statement was not possible, as: 1. The parameter collection would allow a null value to be added, but when the statement was built, it would throw a NullPointerException because it used an ImmutableMap internally, which does not support null values. 2. The translation from a hand-written Statement instance to a proto Statement instance would fail, as it did not take into account that the parameter could be null. Fixes #1679
olavloite
added a commit
to GoogleCloudPlatform/pgadapter
that referenced
this pull request
Feb 11, 2022
- Adds more integration tests using the native PG JDBC driver. - Adds support for null values in query parameters. The PG JDBC driver sends DATE/TIMESTAMP parameters with type code Oid.UNSPECIFIED. Untyped NULL values are currently not supported by the Spangres backend, and also not by the Java client library / JDBC driver. A patch for the Java client library has been submitted here: googleapis/java-spanner#1680
olavloite
added a commit
to GoogleCloudPlatform/pgadapter
that referenced
this pull request
Feb 16, 2022
* fix: support null parameters - Adds more integration tests using the native PG JDBC driver. - Adds support for null values in query parameters. The PG JDBC driver sends DATE/TIMESTAMP parameters with type code Oid.UNSPECIFIED. Untyped NULL values are currently not supported by the Spangres backend, and also not by the Java client library / JDBC driver. A patch for the Java client library has been submitted here: googleapis/java-spanner#1680 * fix: update expected method calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding an untyped null value as a parameter to a statement was not
possible, as:
when the statement was built, it would throw a NullPointerException
because it used an ImmutableMap internally, which does not support
null values.
Statement instance would fail, as it did not take into account that
the parameter could be null.
Fixes #1679