Skip to content

Statement.Builder#bind("some-param").to((Value) null) causes NullPointerException #1679

@olavloite

Description

@olavloite

Setting a statement parameter to an untyped null value will cause a NullPointerException. Example:

Statement.newBuilder("INSERT INTO T (K, V) VALUES (@p1, @p2)")
    .bind("p1")
    .to("k1")
    .bind("p2")
    .to((Value) null)
    .build()))

Untyped null values are often used in ORMs and is commonly used in the JDBC driver. This will also be necessary for PostgreSQL connections, as the PostgreSQL JDBC driver allows applications to supply untyped null parameter values.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/java-spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions