-
Notifications
You must be signed in to change notification settings - Fork 45
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
Emulator does not infer DATE & TIMESTAMP type for null values #31
Comments
Skip testing DML with untyped parameters on the emulator as it does not support untyped parameters. See GoogleCloudPlatform/cloud-spanner-emulator#31
* feat(spanner): Allow untyped nil values in params Removes the restriction that nil valued parameters must be typed. The current restriction prevents the usage of DML statements with one or more untyped nil parameter values to be used to insert/update a value to NULL. Cloud Spanner does not require all parameters to be typed, only when it would otherwise be ambigous what type should be used (e.g. non-NULL STRING/BYTES values). This restriction also prevents the usage of the go/sql driver with gorm, as gorm will generate statements with untyped nil parameter values. Fixes #4481 * fix: skip DML test on emulator Skip testing DML with untyped parameters on the emulator as it does not support untyped parameters. See GoogleCloudPlatform/cloud-spanner-emulator#31 * fix: add missing !
Hello @larkee @olavloite I was trying to debug this issue and would like some steps to reproduce this issue. I tried the following tests and have got a successful run from the emulator. Can u please provide the test case, logs ( --log_requests CLI argument to the emulator) and the error message. Python Test:
Go Test: PASSES, except for DATES, TIMESTAMP
|
@snehashah16 I think your conclusion that this only fails for Interestingly enough that also means that |
Thanks for confirming @olavloite .. Could we please uncomment the Golang tests for the untyped parameters for the emulator test run. I will keep this bug open for DATE and TIMESTAMP. |
The emulator now supports all data types that are also supported by Cloud Spanner. The integration tests also unnecessarily skipped a large number of tests that tried to insert untyped null values as it was assumed that this was not supported. That is however supported for most data types, and only DATE and TIMESTAMP need to be skipped. Updates #GoogleCloudPlatform/cloud-spanner-emulator#31
* test(spanner): enable more tests on emulator The emulator now supports all data types that are also supported by Cloud Spanner. The integration tests also unnecessarily skipped a large number of tests that tried to insert untyped null values as it was assumed that this was not supported. That is however supported for most data types, and only DATE and TIMESTAMP need to be skipped. Updates #GoogleCloudPlatform/cloud-spanner-emulator#31 * fix: remove unused code * fix: use latest emulator version * fix: bump emulator version to 1.4.1
I've just hit this issue as well. Seems less of an enhancement request and more of a straight up bug. Curious if any progress has been made on this front. Here's to hoping! Thanks! |
@jakehilton - we are looking into this issue, and will give you an ETA as soon as we have it. |
We have made the bug fixes related to this issue in the latest release. Please verify. |
Add tests to verify that untyped null statement parameters work with both GoogleSQL, PostgreSQL and the emulator. Verifies that GoogleCloudPlatform/cloud-spanner-emulator#31 has been fixed.
The tests in googleapis/java-spanner#2388 verify that this issue has now been fixed in 1.5.3 of the emulator. |
Add tests to verify that untyped null statement parameters work with both GoogleSQL, PostgreSQL and the emulator. Verifies that GoogleCloudPlatform/cloud-spanner-emulator#31 has been fixed.
* feat(spanner): Allow untyped nil values in params Removes the restriction that nil valued parameters must be typed. The current restriction prevents the usage of DML statements with one or more untyped nil parameter values to be used to insert/update a value to NULL. Cloud Spanner does not require all parameters to be typed, only when it would otherwise be ambigous what type should be used (e.g. non-NULL STRING/BYTES values). This restriction also prevents the usage of the go/sql driver with gorm, as gorm will generate statements with untyped nil parameter values. Fixes #4481 * fix: skip DML test on emulator Skip testing DML with untyped parameters on the emulator as it does not support untyped parameters. See GoogleCloudPlatform/cloud-spanner-emulator#31 * fix: add missing !
* test(spanner): enable more tests on emulator The emulator now supports all data types that are also supported by Cloud Spanner. The integration tests also unnecessarily skipped a large number of tests that tried to insert untyped null values as it was assumed that this was not supported. That is however supported for most data types, and only DATE and TIMESTAMP need to be skipped. Updates #GoogleCloudPlatform/cloud-spanner-emulator#31 * fix: remove unused code * fix: use latest emulator version * fix: bump emulator version to 1.4.1
Originally raised in googleapis/python-spanner-django#566, Spanner will infer the type of a null value if it is not provided but the emulator will throw an error for the same request. This has become an issue for Python ORMs as the suggestion to add this type inference logic to the DBAPI adapter is complicated and requires many changes.
Adding type inference for null values to the emulator to match the production behaviour would resolve the problem and allow us to confidently test against the emulator again.
The text was updated successfully, but these errors were encountered: