-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: PL/pgSQL routine prematurely exits when SELECT ... INTO
statements produce zero rows
#114826
Labels
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
GA-blocker
O-qa
P-1
Issues/test failures with a fix SLA of 1 month
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
T-sql-queries
SQL Queries Team
Comments
mgartner
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-qa
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
labels
Nov 21, 2023
I think this may be a GA blocker. I've added the label. |
Hi @mgartner, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
mgartner
added
the
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
label
Nov 21, 2023
mgartner
changed the title
sql: PL/pgSQL routine prematurely exit when
sql: PL/pgSQL routine prematurely exits when Nov 28, 2023
SELECT ... INTO
statements produce zero rowsSELECT ... INTO
statements produce zero rows
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 5, 2023
Previously, a SELECT INTO statement that returned zero rows wouldn't call the continuation, since the continuation is called as a projection. This patch adds a RIGHT JOIN with a zero-column one-row Values operator to ensure that SELECT INTO statements are correctly null-extended when the underlying SQL statement returns no rows. See the postgres docs: ``` https://www.postgresql.org/docs/16/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW ``` Fixes cockroachdb#114826 Release note (bug fix): Fixed a bug that existed only in pre-release versions v23.2.0-beta.1 and v23.2.0-beta.2 which could cause PLpgSQL routines with SELECT INTO syntax to return early.
craig bot
pushed a commit
that referenced
this issue
Dec 6, 2023
115650: plpgsql: don't exit early when SELECT INTO returns no rows r=DrewKimball a=DrewKimball Previously, a SELECT INTO statement that returned zero rows wouldn't call the continuation, since the continuation is called as a projection. This patch adds a RIGHT JOIN with a zero-column one-row Values operator to ensure that SELECT INTO statements are correctly null-extended when the underlying SQL statement returns no rows. See the postgres docs: ``` https://www.postgresql.org/docs/16/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW ``` Fixes #114826 Release note (bug fix): Fixed a bug that existed only in pre-release versions v23.2.0-beta.1 and v23.2.0-beta.2 which could cause PLpgSQL routines with SELECT INTO syntax to return early. Co-authored-by: Drew Kimball <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this issue
Dec 6, 2023
Previously, a SELECT INTO statement that returned zero rows wouldn't call the continuation, since the continuation is called as a projection. This patch adds a RIGHT JOIN with a zero-column one-row Values operator to ensure that SELECT INTO statements are correctly null-extended when the underlying SQL statement returns no rows. See the postgres docs: ``` https://www.postgresql.org/docs/16/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW ``` Fixes #114826 Release note (bug fix): Fixed a bug that existed only in pre-release versions v23.2.0-beta.1 and v23.2.0-beta.2 which could cause PLpgSQL routines with SELECT INTO syntax to return early.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
GA-blocker
O-qa
P-1
Issues/test failures with a fix SLA of 1 month
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
T-sql-queries
SQL Queries Team
See the example below.
Jira issue: CRDB-33702
The text was updated successfully, but these errors were encountered: