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: fix error message for currval, nextval and setval for sequences #70590

Merged

Conversation

RichardJCai
Copy link
Contributor

Release note (sql change): Small fix to error messaging for
builtin functions for sequences.

Example: SELECT nextval('@#%@!324234') correctly returns
relation "@#%@!324234" does not exist (if the relation doesn't exist)
instead of a syntax error.

SELECT currval('') returns currval(): invalid table name: instead of
pq: currval(): syntax error at or near "to"
DETAIL: source SQL:
ALTER TABLE RENAME TO x
^
HINT: try \h ALTER TABLE

Fixes #34527

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RichardJCai RichardJCai force-pushed the fix_sequence_builtin_error_msg_092221 branch 2 times, most recently from a73197e to bc13103 Compare September 22, 2021 20:04
@RichardJCai RichardJCai requested review from a team and adityamaru and removed request for a team September 22, 2021 20:04
pkg/sql/logictest/testdata/logic_test/sequences Outdated Show resolved Hide resolved
Release note (sql change): Small fix to error messaging for
builtin functions for sequences.

Example: SELECT nextval('@#%@!324234') correctly returns
relation "@#%@!324234" does not exist (if the relation doesn't exist)
instead of a syntax error.

SELECT currval('') returns currval\(\): invalid table name: instead of
pq: currval(): syntax error at or near "to"
DETAIL: source SQL:
ALTER TABLE  RENAME TO x
                    ^
HINT: try \h ALTER TABLE
@RichardJCai RichardJCai force-pushed the fix_sequence_builtin_error_msg_092221 branch from bc13103 to 328ef65 Compare September 23, 2021 15:15
@RichardJCai
Copy link
Contributor Author

TFTR!
bors r=otan

@craig
Copy link
Contributor

craig bot commented Sep 23, 2021

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: currval('') produces bad error message
4 participants