-
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
release-22.2: sql: fix ambigious udf overload with null arguments #109193
release-22.2: sql: fix ambigious udf overload with null arguments #109193
Conversation
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @michae2)
pkg/sql/logictest/testdata/logic_test/udf
line 2849 at r1 (raw file):
statement ok CREATE FUNCTION f88374(i TEXT) RETURNS INT STRICT LANGUAGE SQL AS 'SELECT 2';
Note: I couldn't replicate the original example using INT2 and INT4 in the issue in 22.2 due to an ERROR: function "f88374" already exists with same argument types
which is outside the scope of this PR. However, this patch fixes other types.
Gentle ping for a review on this backport! |
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.
Nice job tracking down the change that fixed this!
For backports (even when they are non-standard like this), remember to prefix PR titles with release-XX.X:
to denote that it's not being merged to the master branch. I added the prefix to this PR.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @michae2 and @rharding6373)
-- commits
line 4 at r1:
nit: Can you link to the PR?
pkg/sql/logictest/testdata/logic_test/udf
line 2849 at r1 (raw file):
Previously, rharding6373 (Rachael Harding) wrote…
Note: I couldn't replicate the original example using INT2 and INT4 in the issue in 22.2 due to an
ERROR: function "f88374" already exists with same argument types
which is outside the scope of this PR. However, this patch fixes other types.
That's fine. We never backported the fix (#96481) that allows multiple UDFs with non-identical types in the same family - which is why you're getting that error in 22.2.
This change backports a small change from a larger PR (cockroachdb#98162) that prevents short-circuiting type checking for UDF function overloads. This allows us to do more precise type checking even if inputs are NULL. Epic: none Fixes: cockroachdb#88374 Release note (bug fix): Fixes ambiguous calls to UDFs with NULL arguments.
d511aef
to
4d7382e
Compare
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.
Thanks for that.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @michae2)
Previously, mgartner (Marcus Gartner) wrote…
nit: Can you link to the PR?
Done.
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.
Add the "larger PR" number to the issue description too, if you'd like.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @michae2)
TFTR! |
This change backports a small change from a larger PR (#98162) that prevents short-circuiting type checking for UDF function overloads. This allows us to do more precise type checking even if inputs are NULL.
Epic: none
Fixes: #88374
Release note (bug fix): Fixes ambiguous calls to UDFs with NULL arguments.
Release justification: Fixes a bug referencing UDF overloads.