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: properly handle COMMIT/ROLLBACK in nested procedures #122266
Labels
A-sql-routine
UDFs and Stored Procedures
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
docs-known-limitation
O-qa
T-sql-queries
SQL Queries Team
Comments
DrewKimball
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-qa
T-sql-queries
SQL Queries Team
A-sql-routine
UDFs and Stored Procedures
labels
Apr 12, 2024
Right now, this can lead to unexpected behavior since the deferred CALL execution isn't set up to handle nested routines:
Result:
|
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 18, 2024
This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs cockroachdb#122266 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 23, 2024
This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs cockroachdb#122266 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 24, 2024
This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs cockroachdb#122266 Release note: None
craig bot
pushed a commit
that referenced
this issue
Apr 24, 2024
122657: plpgsql: disallow txn control in udfs and nested procedures r=DrewKimball a=DrewKimball This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs #122266 Release note: None Co-authored-by: Drew Kimball <drewk@cockroachlabs.com>
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 24, 2024
This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs cockroachdb#122266 Release note: None
DrewKimball
added a commit
that referenced
this issue
Apr 25, 2024
This patch adds validation for transaction control statements, so that attempting to use them from within a UDF results in an error. In addition, attempting to use a transaction control statement from a nested stored procedure call will now result in an "unimplemented" error. Informs #122266 Release note: None
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-sql-routine
UDFs and Stored Procedures
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
docs-known-limitation
O-qa
T-sql-queries
SQL Queries Team
Postgres allows using
COMMIT/ROLLBACK
in nested routines under the following conditions (from the docs):In the long term, we should allow
COMMIT/ROLLBACK
in this case, and check for intervening statements to produce the correct error. For 24.1, we should just disallow a nested routine from usingCOMMIT/ROLLBACK
entirely.Jira issue: CRDB-37782
The text was updated successfully, but these errors were encountered: