-
Notifications
You must be signed in to change notification settings - Fork 6.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
Fix too aggressive evaluation of args in default column expr #44547
Conversation
Can you look at the Fast test failure? |
Yep, I'm looking at it right now :) |
Stress test (asan) - #45308 |
Backport #44547 to 22.12: Fix too aggressive evaluation of args in default column expr
if (!args || args->children.size() != 2) | ||
return -1; | ||
|
||
if (args->children[1]->as<ASTFunction>()) |
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.
@tavplubix You're checking only for ASTFunction
here but what if the second argument of IN
is a subquery? Like x IN (SELECT id FROM tbl)
. SELECT id FROM tbl
isn't a function but it seems it doesn't need to be evaluated during normalization.
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.
Oh I see
if (arg->as<ASTFunction>()) |
ASTFunction
so the normalization evaluates only functions.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed a bug in normalization of a
DEFAULT
expression inCREATE TABLE
statement. The second argument of functionin
(or the right argument of operatorIN
) might be replaced with the result of its evaluation during CREATE query execution. Fixes #44496