-
Notifications
You must be signed in to change notification settings - Fork 25.8k
SQL: Wrong NULL folding of expression #35232
Copy link
Copy link
Closed
Labels
Description
SELECT POSITION('x',LCASE("first_name")) pos, "first_name" FROM "test_emp"
WHERE POSITION('x',LCASE("first_name")) != 0 OR POSITION('x',LCASE("first_name")) IS NULL;
is translated to:
"InternalSqlScriptUtils.nullSafeFilter(InternalSqlScriptUtils.neq(InternalSqlScriptUtils.position(params.v0,InternalSqlScriptUtils.lcase(InternalSqlScriptUtils.docValue(doc,params.v1))),params.v2))"
The right part of the OR is missing because it's wrongly folded by the FoldNull rule. The POSITION can potentially be null.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.