-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ApplyVSchemaDDL
: escape Sequence names when writing the VSchema
#12519
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
28ede72
to
f29d767
Compare
@vitessio/query-serving please review |
Signed-off-by: Hormoz Kheradmand <[email protected]>
I've just rewritten the branch to solve this more elegantly. One might think "this should have always been written as such" 😄 Could I please get a review? And any word on whether this could be backported? Our team at Shopify would have to otherwise plan a forked release fairly soon. Thanks everyone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elegant is correct 😄
LGTM, and I think we can backport.
We'll wait to get at least 1 more approval from the query-serving team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice stuff
Signed-off-by: Hormoz Kheradmand <[email protected]>
Description
We use
ALTER VSCHEMA ... ADD AUTO_INCREMENT ...
statements to provision new sharded tables with their Sequence table references, however we ran into a bug because our sequence tables are stored in keyspaces that contain dashes (e.g.`app-name-global`.sequence_table
).The issue is that the
ApplyVSchemaDDL
function does not escape the value of theSequence
field below even though it's capable of parsing user input correctly:Not surprising, since we're going through a cycle of parsing user input (from a SQL statment) and then trying to write something out to the VSchema's
Table.AutoIncrement.Sequence
field with the (new-ish?) understanding that it will be parsed usingsqlparser
again. As the VSchema docs mention, "If necessary, the reference to the sequence table lookup.user_seq can be escaped using backticks."We would really love to have this be backported and have a
v14.0.5
minor version be released with this fix.Related Issue(s)
Checklist
Deployment Notes
There should be no functional change in correct existing behaviour. The failing case will be fixed by the changes.