Skip to content
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

sql/schemachanger: create sequence can return an internal error on a missing prefix #106302

Closed
fqazi opened this issue Jul 6, 2023 · 0 comments · Fixed by #106333
Closed

sql/schemachanger: create sequence can return an internal error on a missing prefix #106302

fqazi opened this issue Jul 6, 2023 · 0 comments · Fixed by #106333
Assignees
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. C-test-failure Broken test (automatically or manually discovered). O-rsg Random Syntax Generator T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@fqazi
Copy link
Collaborator

fqazi commented Jul 6, 2023

When CREATE SEQUENCE was added to the declarative schema changer, the call that we used to resolve
the prefix for the sequences was one did return a fatal assertion. Instead, our resolution function
should return appropriate errors for missing databases/schemas.

Example statement

CREATE TEMP SEQUENCE TIMESTAMPTZ . PRIMARY . IS;

Jira issue: CRDB-29496

@fqazi fqazi added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 6, 2023
@fqazi fqazi self-assigned this Jul 6, 2023
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Jul 6, 2023
@rafiss rafiss added C-test-failure Broken test (automatically or manually discovered). O-rsg Random Syntax Generator labels Jul 6, 2023
@rimadeodhar rimadeodhar added the branch-master Failures and bugs on the master branch. label Jul 7, 2023
craig bot pushed a commit that referenced this issue Jul 13, 2023
106333: sql/schemachanger: fix prefix resolution errors during CREATE r=fqazi a=fqazi

Previously, in the declarative schema changer, when resolving prefixes for new objects (CREATE FUNCTION / CREATE SEQUENCE), we would incorrectly generate internal errors if the resolution failed. This was incorrect and a regression versus the legacy schema changer. To address this, this patch refactors the resolution logic to generate appropriate errors for target objects when the prefix can't be resolved.

Fixes: #106302

Release note: None

Co-authored-by: Faizan Qazi <[email protected]>
@craig craig bot closed this as completed in 9da5dd8 Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. C-test-failure Broken test (automatically or manually discovered). O-rsg Random Syntax Generator T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants