-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: do not inline strict UDFs #95240
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
Comments
mgartner
added a commit
to mgartner/cockroach
that referenced
this issue
Jan 13, 2023
This commit removes the field `CalledOnNullInput` of `tree.RoutineExpr`. Strict UDFs are now wrapped in a `CASE` expression so that they are not invoked when any of the arguments are NULL. This fixes a bug that caused strict functions be evaluated when presented with `NULL` arguments after being inlined. This also allows for the removal of special logic in evaluation of `tree.RoutineExpr`. A positive side effect of this change is that strict UDFs will be folded to NULL at optimization-time if they are presented with constant NULL arguments. This is made possible by existing normalization rules. Fixes cockroachdb#95240 There is no release note because the bug is not present in any releases. Release note: None
mgartner
added a commit
to mgartner/cockroach
that referenced
this issue
Jan 18, 2023
This commit removes the field `CalledOnNullInput` of `tree.RoutineExpr`. Strict UDFs are now wrapped in a `CASE` expression so that they are not invoked when any of the arguments are NULL. This fixes a bug that caused strict functions be evaluated when presented with `NULL` arguments after being inlined. This also allows for the removal of special logic in evaluation of `tree.RoutineExpr`. A positive side effect of this change is that strict UDFs will be folded to NULL at optimization-time if they are presented with constant NULL arguments. This is made possible by existing normalization rules. Fixes cockroachdb#95240 There is no release note because the bug is not present in any releases. Release note: None
craig bot
pushed a commit
that referenced
this issue
Jan 19, 2023
94002: ui: add missing filters for workload insights and active execution pages r=gtr a=gtr Fixes #87741, #87783. Previously, the workload insights page was missing a filter for insights type for both the statement and transaction tabs. Furthermore, the active execution pages for statement and transactions was also missing a status filter. This commit adds the ability to filter by insights type for the workload insights page and the ability to filter by execution status for the active execution pages. DB Console video demos: - [Demo](https://www.loom.com/share/39c7b882b8b84ebfb39203d219f05075) for workload insights page. - [Demo](https://www.loom.com/share/806c1238233741e2b17882e3665ffabf) for active execution page. - [Demo](https://www.loom.com/share/e601c39c20cb45b28aae5ac468216ba6) for selecting more than one option. CC Console video demos - [Demo](https://www.loom.com/share/975b0952a43d4ab6908cbb5a0533f335) for filtering by execution status on statements tab - [Demo](https://www.loom.com/share/f60690b61c8d4665b87b0f31f639596c) for filtering by execution status on transactions tab - [Demo](https://www.loom.com/share/13cd1865edcb4b8d87ba7b89217e697d) for filtering by workload insight type Release note (ui change): added an insights type filter for the workload insights page, added a execution status filter for the active execution pages. Updated the tooltip for execution status to include the definition for the "Waiting" status. 94797: sql: implement strict UDFs with CASE r=mgartner a=mgartner This commit removes the field `CalledOnNullInput` of `tree.RoutineExpr`. Strict UDFs are now wrapped in a `CASE` expression so that they are not invoked when any of the arguments are NULL. This fixes a bug that caused strict functions be evaluated when presented with `NULL` arguments after being inlined. This also allows for the removal of special logic in evaluation of `tree.RoutineExpr`. A positive side effect of this change is that strict UDFs will be folded to NULL at optimization-time if they are presented with constant NULL arguments. This is made possible by existing normalization rules. Fixes #95240 There is no release note because the bug is not present in any releases. Release note: None 95382: upgrades_test: speed up TestRoleMembersIDMigration1500Users test r=rafiss a=andyyang890 This patch speeds up the TestRoleMembersIDMigration1500Users test by moving the creation of test users into transactions. On my Mac, this change reduced the running time from ~55s to ~15s (a 4x speedup). Fixes #95268 Release note: None Co-authored-by: gtr <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Andy Yang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
On master, inlining of strict UDFs produces incorrect results:
One of the rows returned should be
NULL
.Jira issue: CRDB-23417
The text was updated successfully, but these errors were encountered: