-
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: a function returning SETOF RECORD with OUT params returns one row #128403
Labels
A-sql-udf
branch-master
Failures and bugs on the master branch.
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
branch-release-24.1
Used to mark GA and release blockers, technical advisories, and bugs for 24.1
branch-release-24.2
Used to mark GA and release blockers, technical advisories, and bugs for 24.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
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
DrewKimball
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
A-sql-udf
labels
Aug 6, 2024
Hi @DrewKimball, please add branch-* labels to identify which branch(es) this C-bug affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
DrewKimball
added
branch-release-24.1
Used to mark GA and release blockers, technical advisories, and bugs for 24.1
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
branch-release-24.2
Used to mark GA and release blockers, technical advisories, and bugs for 24.2
branch-master
Failures and bugs on the master branch.
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
labels
Aug 6, 2024
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 11, 2024
This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes cockroachdb#128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row.
This was referenced Dec 11, 2024
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 12, 2024
This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes cockroachdb#128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row.
craig bot
pushed a commit
that referenced
this issue
Dec 12, 2024
137251: sql: implement RETURNS TABLE syntax r=DrewKimball a=DrewKimball #### sql: do not limit set-returning UDF when it has OUT parameters This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes #128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row. #### sql: implement RETURNS TABLE syntax This commit implements `RETURNS TABLE` for UDFs. `RETURNS TABLE` is syntactic sugar for `RETURNS SETOF` with: - RECORD if there are multiple TABLE parameters, or - the type of the single TABLE parameter. The TABLE parameters are added to the list of routine parameters. Fixes #100226 Release note (sql change): Added support for `RETURNS TABLE` syntax when creating a UDF. Co-authored-by: Drew Kimball <[email protected]>
craig bot
pushed a commit
that referenced
this issue
Dec 13, 2024
137251: sql: implement RETURNS TABLE syntax r=DrewKimball a=DrewKimball #### sql: do not limit set-returning UDF when it has OUT parameters This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes #128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row. #### sql: implement RETURNS TABLE syntax This commit implements `RETURNS TABLE` for UDFs. `RETURNS TABLE` is syntactic sugar for `RETURNS SETOF` with: - RECORD if there are multiple TABLE parameters, or - the type of the single TABLE parameter. The TABLE parameters are added to the list of routine parameters. Fixes #100226 Release note (sql change): Added support for `RETURNS TABLE` syntax when creating a UDF. Co-authored-by: Drew Kimball <[email protected]>
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 13, 2024
This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes cockroachdb#128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 13, 2024
This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes cockroachdb#128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Dec 13, 2024
This commit fixes a bug that caused the `SetOf` option for the UDF `ReturnType` to be overwritten if the UDF had OUT parameters. The bug caused a `LIMIT 1` to be imposed on the UDF's final body statement, so that the UDF returned only a single row. Fixes cockroachdb#128403 Release note (bug fix): Fixed a bug existing since v24.1 that would cause a set-returning UDF with OUT parameters to return a single row.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-sql-udf
branch-master
Failures and bugs on the master branch.
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
branch-release-24.1
Used to mark GA and release blockers, technical advisories, and bugs for 24.1
branch-release-24.2
Used to mark GA and release blockers, technical advisories, and bugs for 24.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
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
It is possible to use
RETURNS SETOF
syntax to indicate that a user-defined function returns more than one row. This syntax is compatible with theRECORD
return type:However, naming the elements of the record using OUT parameters causes CRDB to truncate the result:
Contrast this with Postgres, which returns all the rows:
Jira issue: CRDB-40994
The text was updated successfully, but these errors were encountered: