Fix quoted table names rejected as invalid#182
Open
shurarama wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Open
Fix quoted table names rejected as invalid#182shurarama wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
shurarama wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Conversation
ParseTable() did not strip double quotes from identifiers before validation, unlike ParseKeyspace() and ParseColumnContext() which already called TrimDoubleQuotes(). This caused all queries with quoted table names (e.g. "employees_target") to fail.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for quoted table and keyspace names in the Cassandra-Bigtable proxy. The ParseTable function now utilizes TrimDoubleQuotes to sanitize table names, and a new test case has been added to validate this behavior in SELECT queries. I have no feedback to provide.
Collaborator
|
Hi @shurarama, thanks for the contribution! Same as the other PR: please squash your commits an use a conventional commit message that starts with |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #184
Summary
ParseTable()intranslators/common/utils.godid not callTrimDoubleQuotes()before validating the table name, causing all queries with double-quoted table names to fail withinvalid table name: "..."ParseKeyspace()(line 832) andParseColumnContext()(line 343) already strip quotes —ParseTable()was simply missing the same callTrimDoubleQuotes()call inParseTable()before validationAffected queries
All DML/DDL with quoted table names across all translators (SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, TRUNCATE):
Test plan
Quoted table and keyspace names— verifies quoted identifiers are accepted and strippedinvalid table name: "test_table"