spanner/spansql: Database option version_retention_period
is not parsed correctly if there are tables after ALTER DATABASE
statement
#5970
Labels
api: spanner
Issues related to the Spanner API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
Client
Cloud Spanner
Environment
Go playground
Go Environment
(This is the environment of my PC, not Go playground)
Code
https://go.dev/play/p/I5rWmNCRvda
Expected behavior
version_retention_period
should be parsed to7d
Actual behavior
version_retention_period
is actually parsed toUserId
(See more details: https://go.dev/play/p/I5rWmNCRvda )Parsed DDL is "ALTER DATABASE test SET OPTIONS (optimizer_version=4, version_retention_period='UserId', enable_key_visualizer=true)"
Additional context
This behavior is not observed if there is no table after "ALTER DATABASE" statement.
In short, the following query is parsed correctly.
Suspecting pointer passing implementation around here:
google-cloud-go/spanner/spansql/parser.go
Line 1746 in dd8973b
The text was updated successfully, but these errors were encountered: