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
plpgsql: improve block formatting and unimplemented errors #117608
Conversation
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
The first commit is #117511. |
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.
Great! Looks like there's a few more tests to clean up with the new formatting, but otherwise, LGTM!
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
This commit makes a few fixes to formatting for PL/pgSQL routines in preparation for nested blocks support, as well as a few misc fixes: 1. Blocks now print a semicolon after `END`. While the semicolon is optional for the root block, it is non-optional for nested blocks. 2. Block labels are now correctly displayed (previously, they were ignored). 3. An extra newline has been removed from the output of `SHOW CREATE FUNCTION` and `SHOW CREATE PROCEDURE`. 4. RAISE statements now capitalize the log level (e.g. `notice` -> `NOTICE`). Informs cockroachdb#114775 Informs cockroachdb#112136 Release note: None
This commit adds a parse-time check that the labels on a PLpgSQL block (if any) match. If the labels do not match, an expected syntax error is returned. This commit also adds an "unimplemented" error for block labels. Finally, errors that don't use formatting arguments have been moved to the bottom of the file for clarity. Informs cockroachdb#114775 Release note (bug fix): Incorrectly labeled PL/pgSQL blocks now return an expected syntax error.
cda5e81
to
b226b1a
Compare
TFTR! |
bors r+ |
Build succeeded: |
plpgsql: misc formatting fixes
This commit makes a few fixes to formatting for PL/pgSQL routines in
preparation for nested blocks support, as well as a few misc fixes:
END
. While the semicolon isoptional for the root block, it is non-optional for nested blocks.
SHOW CREATE FUNCTION
and
SHOW CREATE PROCEDURE
.notice
->NOTICE
).Informs #114775
Informs #112136
Release note: None
plpgsql: return errors for block labels
This commit adds a parse-time check that the labels on a PLpgSQL block
(if any) match. If the labels do not match, an expected syntax error is
returned. This commit also adds an "unimplemented" error for block labels.
Finally, errors that don't use formatting arguments have been moved to the
bottom of the file for clarity.
Informs #114775
Release note (bug fix): Incorrectly labeled PL/pgSQL blocks now return
an expected syntax error.