-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spanner/spansql): PROTO BUNDLE and protobuf type parsing fixes (#…
…11279) * fix: spansql: fix NOT NULL protobuf column type parsing The protobuf type-name parser was so greedy that it failed on NOT NULL columns. In particular, it wasn't aware that unquoted tokens should be separated by dots, and that quoted tokens shouldn't be concatenated with anything else. Fix this by adding a boolean to handle that alternation and only allowing quoted IDs if nothing else has been consumed. (then bailing immediately after a quoted ID so we don't try to consume anything else) * fix: spansql: fix invalid CAST tests A misreading of the spanner docs lead to tests that indicated that casting `AS ENUM` or `AS PROTO` was valid syntax (despite not specifying _which_ protobuf enum or message type to cast to). Replace these cases with ones that validate casting to specific enum/message types. Thanks to @apstndb for calling this out on #10945. * fix spansql: CREATE PROTO BUNDLE SQL with 0 types Fix a bug in CreateProtoBundle.SQL() which unintentionally generated the DDL when there were no types listed: ``` CREATE PROTO BUNDLE (``) ``` --------- Co-authored-by: Sri Harsha CH <[email protected]>
- Loading branch information
1 parent
5ce14e3
commit b1ca714
Showing
4 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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