Repository navigation
Do not rewrite an OR chain into IN over Variant constants with several alternatives - #133127
Conversation
|
Workflow [PR], commit [1800fa4] Summary: ✅
AI ReviewSummaryThe PR preserves equality semantics by keeping Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 10 s compile time in total, 7 of them have a recent master baseline. |
Closes: #132702
Description
tryReplaceOrEqualsChainWithInalready skipped the rewrite when the expression is aVariantorDynamic, but not when only the constants are. It builds theINtuple from each constant'sField, which does not keep theVariantalternative or theDynamictype, so the set puts the value into whatever type accepts it first.5::UInt64::Variant(Date, UInt64)became1970-01-06as aDate, whileequalscompares theUInt64. On aDateTimecolumn the matching row was dropped, and on aDatecolumn a row came back instead ofILLEGAL_TYPE_OF_ARGUMENT.toDate(5)::Dynamichad the same problem the other way round.Now the chain is kept when a constant's type contains
Dynamicor aVariantwith more than one alternative. A single-alternativeVariantcan only go to one place, so it is still rewritten (05059_nested_variant_constant_folding_distributedchecks that). ThenotIndirection is not affected: anotEqualswith such a constant isNullableand is never merged.The new test fails on master.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed wrong results of an
ORchain of equalities withVariantorDynamicconstants (for examplex = 5::UInt64::Variant(Date, UInt64) OR ...), which was rewritten into anINthat matched different rows.Workflow [PR]
Sync PR [sync-upstream/pr/133127]
Version info
26.12.1.240-master(included in26.12and later)