Repository navigation
Fix false monotonicity of intDiv(unsigned, constant) causing Invalid binary search result in MergeTreeSetIndex - #107586
Conversation
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-2:20260616-024800 |
|
cc @rschu1ze @novikd — could you review this? It fixes a false monotonicity claim for |
|
Workflow [PR], commit [7c528a2] Summary: ❌
AI ReviewSummaryThis PR closes several real Findings
Final Verdict
|
1e7ee28 to
c3f9516
Compare
|
Thanks, both points were correct. Reworked: the endpoint-sampling check is replaced with an analytical crossing test.
Verified on a debug build:
The regression test |
Pre-PR validation gate (rework after review)
Session id: cron:clickhouse-worker-slot-1:20260616-084300 |
tiandiwonder
left a comment
There was a problem hiding this comment.
The intDiv straddle-test rewrite looks correct, but CI is red because 00940_order_by_read_in_order_query_plan and 02911_analyzer_order_by_read_in_order_query_plan aren't updated: with y UInt32, intDiv(intDiv(y, -2), -3) is now correctly non-monotonic at plan time and drops from the prefix sort description. Update both .reference files rather than reverting the change — the old plan would mis-order an unsigned column whose values cross 2^31, so this is a fix, not a regression.
c3f9516 to
5900dcb
Compare
Pre-PR validation gate (updated for commit 5900dcb)This push fixes the
Session id: cron:clickhouse-worker-slot-3:20260616-102600 |
|
References updated in 5900dcb (both |
|
|
||
| // `divide` is floating-point (saturates, order-preserving), and `intDiv` whose result | ||
| // type is also unsigned never wraps, so both are always monotonic. | ||
| if (name_view == "divide" || !(isUInt(arg_type) && isInt(ret_type))) |
There was a problem hiding this comment.
optional: flip this to the positive form if (name_view == "intDiv" && isUInt(arg_type) && isInt(ret_type)), matching the unbounded branch above, so both sites read identically.
the negated divide || !(...) makes the reader apply De Morgan to see the fall-through is exactly intDiv && isUInt && isInt; behavior is the same either way.
There was a problem hiding this comment.
Done in 92ca863. Both branches now use the positive name_view == "intDiv" && isUInt(arg_type) && isInt(ret_type) form.
| if (name_view == "divide" || !(isUInt(arg_type) && isInt(ret_type))) | ||
| return {true, is_constant_positive, true, is_strict}; | ||
|
|
||
| // `intDiv(unsigned, signed-const)` wraps at `D = 2^(width-1)` (see |
There was a problem hiding this comment.
optional: this wraps at D = 2^(width-1) sentence repeats the header of intDivRangeCrossesSignedWrap (also restated at the unbounded branch) — a bare // see intDivRangeCrossesSignedWrap would do.
the locally-useful bits (why divide/unsigned-result are always-monotonic, why this path returns is_always_monotonic=false) aren't in the helper and are worth keeping.
There was a problem hiding this comment.
Done in 92ca863. Trimmed the duplicated wrap-point description to a reference to intDivRangeCrossesSignedWrap, keeping the locally-useful notes (why divide/unsigned-result stay always-monotonic, and why this branch returns is_always_monotonic=false).
| -- UInt8 over the whole domain: intDiv(a, 100) is a step function whose endpoints intDiv(0,100)=0 and | ||
| -- intDiv(255,100)=0 are equal while the interior jumps, so endpoint comparison alone cannot prove | ||
| -- monotonicity. The whole-domain IN with no other key bound also exercises the unbounded (null, null) path. | ||
| CREATE TABLE t_intdiv_mono (a UInt8) ENGINE = MergeTree ORDER BY a SETTINGS index_granularity = 1; |
There was a problem hiding this comment.
the wrap path is only exercised on UInt8 and UInt64; UInt16/UInt32 aren't covered, and NOT IN — the operator that actually surfaced the silent over-pruning, since IN returns the right count even unpruned — is only tested on UInt64.
worth one UInt32 table crossing 2^31 with a NOT IN to lock down a mid width on the operator that regresses.
There was a problem hiding this comment.
Added in 92ca863: a UInt32 table whose single granule [100, 4294967295] crosses 2^31, tested with NOT IN (0) for both a positive and a negative divisor. Verified both directions on the debug binary: without the fix the endpoints intDiv(100,2e9)=0 and intDiv(4294967295,2e9)=0 collapse the range to [0,0], so NOT IN (0) prunes the whole granule and returns 0 instead of the ground-truth 2 (silent over-pruning, no abort); with the fix the crossing range is non-monotonic, nothing is pruned, and the count is 2.
…ndex
FunctionBinaryArithmetic::getMonotonicityForRange claimed intDiv(variable,
constant) is always monotonic. That is wrong when the dividend is unsigned and
the intDiv result type is signed: intDiv casts the dividend to a signed type
when the divisor is signed (DivideIntegralImpl), and ResultOfIntegerDivision
makes the result signed with the dividend width. So an unsigned value
>= 2^(width-1) reinterprets as negative. For example intDiv(UInt64, Int64-const)
has an Int64 result, and intDiv(2^63, c) flips sign relative to
intDiv(2^63 - 1, c). intDiv(unsigned, signed-const) is therefore a step function
with a single discontinuity at D = 2^(width-1): monotonic on each side of D but
not across it.
When such a chain feeds an IN/NOT IN key condition,
applyMonotonicFunctionsChainToRange builds a Range with left > right, and
MergeTreeSetIndex::checkInRange hits the std::partition_point invariant
begin <= end. In debug builds this aborts with the LOGICAL_ERROR
'Invalid binary search result in MergeTreeSetIndex'; in release builds
checkInRange falls back to {true, true} (no pruning).
Found by the AST fuzzer on master (STID 3252-3a4a): a UInt64 key divided by a
large negative Int128 constant. This is the variable/constant counterpart of
the const/variable case fixed in ClickHouse#103621.
The fix detects whether the range [left_point, right_point] crosses the
discontinuity D analytically (intDivRangeCrossesSignedWrap), treating a null
endpoint as the unsigned-domain limit. A crossing range is reported as
non-monotonic (no pruning); a range on one side of D stays monotonic on that
range but is not always-monotonic. This is applied in both the finite-range
branch and the unbounded (null, null) branch that ReadInOrderOptimizer and
KeyCondition use to probe is_always_monotonic.
An earlier version of this fix compared only the transformed endpoints, which
is insufficient: intDiv is a step function whose endpoints can map to equal
values while the interior changes direction (e.g. UInt8 / 100 over [0, 255]),
so endpoint comparison can still report spurious monotonicity and over-prune
interior rows. The analytical crossing check replaces it.
divide (floating-point) and intDiv with an unsigned result never wrap and stay
always-monotonic as before.
As a consequence, read-in-order no longer treats intDiv(UInt32 column,
negative constant) as monotonic, so its sort-key prefix is dropped in
00940/02911_order_by_read_in_order_query_plan. That prior plan was unsafe:
intDiv(UInt32, negative-const) has an Int32 result and is non-monotonic across
2^31, so reading in order would have produced wrong row order on data crossing
that point (the test data y in 0..3 never crossed it, so the bug was latent).
The .reference files are updated to reflect the corrected plans.
The intDiv guard is spelled in the positive form intDiv && isUInt && isInt in
both branches for readability, and 04340 covers a UInt32 range crossing 2^31
under NOT IN (the operator that exposes the silent over-pruning).
Related: ClickHouse#90461
Co-Authored-By: Claude Opus 4.8 <[email protected]>
5900dcb to
92ca863
Compare
Pre-PR validation gate (commit 92ca863)This run addresses @tiandiwonder's three follow-up review comments: positive-form guard (both branches), comment dedup, and a UInt32-crossing-2^31 NOT IN test case.
Session id: cron:clickhouse-worker-slot-3:20260616-123600 |
The intDiv(unsigned, constant) monotonicity guard keyed off the signed return type (isInt(ret_type)). ResultOfIntegerDivision makes the result signed whenever either operand is signed, so intDiv(UInt64, 10.0) gets an Int64 result even though Float64 is the divisor. DivideIntegralImpl only reinterprets the dividend through make_signed_t in the integer/integer branch; a Float divisor computes through floating point and never wraps at 2^63. The guard therefore over-matched a Float constant divisor and falsely reported the (null, null) probe as non-monotonic, disabling key and read-in-order pruning that should stay unchanged. Gate on the divisor being a signed integer (isInt(divisor_type)) instead, matching DivideIntegralImpl's signed-cast branch exactly. With an unsigned dividend this still implies a signed result, so the wrap handling is unchanged for integer divisors (including the Int128 divisor in the fuzzer repro); only Float/Decimal divisors are excluded. 04340 gains a Float-divisor case asserting both that key pruning matches the ground-truth count and that read-in-order keeps intDiv in the prefix sort (the read-in-order settings are pinned on that EXPLAIN because the runner randomizes optimize_read_in_order). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Fixed in d3be10a. You are right: Both branches now gate on the divisor being a signed integer, Verified on the debug binary:
04340 gains a Float-divisor case asserting the index count matches ground truth and that read-in-order keeps The two 07:08Z items are addressed in 92ca863: the interior sign-flip is now detected analytically by |
Pre-PR validation gate (fixup d3be10a)
Session id: cron:clickhouse-worker-slot-3:20260616-142500 |
|
CI status on d3be10a (our-pr-ci-monitor): The only failed check is
The AST-fuzzer finding this PR targets (Invalid binary search result in MergeTreeSetIndex, STID 3252-3a4a) no longer reproduces on this SHA. The Bugfix-validation rows ("Lost s3 keys", "OOM in dmesg", "Lost forever for SharedMergeTree") are the usual SharedMergeTree+S3 harness noise (job passed). A (cron:our-pr-ci-monitor:20260616-203000) |
| // so reject it (no pruning); a range on one side is monotonic on that range but not | ||
| // always-monotonic. The wrap is exclusive to the signed-integer divisor path; a Float | ||
| // divisor computes through floating point and never wraps. | ||
| if (name_view == "intDiv" && isUInt(arg_type) && isInt(divisor_type)) |
There was a problem hiding this comment.
this guard only covers isUInt(dividend) && isInt(divisor), but the mirror case is wrong too: with a signed dividend and an unsigned constant whose high bit is set, DivideIntegralImpl casts the divisor through a signed type (SignedCastB), so it's effectively negative and the function is decreasing — but is_constant_positive above is read from the raw unsigned constant (0 < 255 -> true), so this falls through to {true, positive, always-monotonic} and an intDiv(int_key, ...) IN (...) condition builds a Range with left > right, i.e. the same Invalid binary search result in MergeTreeSetIndex this PR fixes, in the symmetric operand config.
reproduces on a debug build — the two queries differ only in the divisor's declared type (same effective value -56):
CREATE TABLE t (a Int8) ENGINE=MergeTree ORDER BY a SETTINGS index_granularity=1;
INSERT INTO t SELECT number-127 FROM numbers(255);
SELECT count() FROM t WHERE intDiv(a, toInt8(-56)) IN (1,2); -- ok: 72
SELECT count() FROM t WHERE intDiv(a, toUInt8(200)) IN (1,2); -- Aborted (core dumped)it's pre-existing on master (the signed-dividend fallthrough is unchanged here), so this is an incomplete fix rather than a regression — but worth closing the sibling case: derive is_constant_positive from the effective (signed-reinterpreted) divisor, or reject isInt(dividend) && isUInt(divisor) with the high bit set, plus a regression test.
There was a problem hiding this comment.
Confirmed and fixed in 43748f3. intDiv(Int8, toUInt8(200)) is numerically intDiv(Int8, toInt8(-56)), which master already prunes correctly as monotonic decreasing, so the principled fix is option 1: derive the direction from the effective divisor rather than reject the case.
DivideIntegralImpl reinterprets the divisor via SignedCastB only when sizeof(dividend) <= sizeof(divisor); with a wider dividend the divisor widens into the signed dividend type and stays positive. New helper intDivConstReinterpretsNegative mirrors that exact gate (signed dividend, unsigned divisor, sizeof(dividend) <= sizeof(divisor), high bit set) and flips is_constant_positive to false. No discontinuity here (the signed dividend is never reinterpreted), so the function stays fully monotonic, only its direction reverses, and pruning is preserved.
04340 now covers the mirror case at widths 8/16/32, a high-bit-not-set case (no flip), and a sizeof(dividend) > sizeof(divisor) no-flip case. Validated on a debug build: your repro aborts on the old binary and returns 72 on the new one; NOT IN and read-in-order (DESC keeps intDiv in prefix sort) confirm the decreasing direction.
…wrong direction The prior fix handled intDiv(unsigned_dividend, signed_integer_const), where DivideIntegralImpl reinterprets the dividend as signed and the function becomes a step function with a discontinuity at 2^(width-1). The symmetric operand config is also wrong and pre-exists on master: with a signed dividend and an unsigned constant divisor whose high bit is set, DivideIntegralImpl reinterprets the divisor through make_signed_t of the wider operand (SignedCastB when sizeof(dividend) <= sizeof(divisor)), so e.g. toUInt8(200) becomes -56 and intDiv is monotonic decreasing. But is_constant_positive is read from the raw unsigned constant (0 < 200 -> true), so the chain is reported increasing, KeyCondition builds a Range with left > right, and MergeTreeSetIndex::checkInRange aborts with "Invalid binary search result in MergeTreeSetIndex" (debug) / silently mis-prunes (release). Repro on a debug build (the two queries differ only in the divisor's declared type, same effective value -56): CREATE TABLE t (a Int8) ENGINE=MergeTree ORDER BY a SETTINGS index_granularity=1; INSERT INTO t SELECT number-127 FROM numbers(255); SELECT count() FROM t WHERE intDiv(a, toInt8(-56)) IN (1,2); -- ok: 72 SELECT count() FROM t WHERE intDiv(a, toUInt8(200)) IN (1,2); -- Aborted Fix at the source: when the divisor reinterprets as negative (intDivConstReinterpretsNegative), derive the direction from the effective signed value. The signed dividend is never reinterpreted, so there is no discontinuity and the function stays fully monotonic; only its direction is reversed. This makes intDiv(Int8, toUInt8(200)) behave identically to the equivalent intDiv(Int8, toInt8(-56)), preserving key/read-in-order pruning. The flip only occurs for sizeof(dividend) <= sizeof(divisor); otherwise the divisor widens into the dividend's signed type and stays positive. Extends regression test 04340 with the mirror case at widths 8/16/32, a high-bit-not-set case, and a sizeof(dividend) > sizeof(divisor) no-flip case.
Pre-PR validation gate (HEAD 43748f3, mirror-case fixup)
Session id: cron:clickhouse-worker-slot-4:20260618-012900 |
|
CI finished on HEAD
The targeted cases (unsigned-dividend wrap, Float-divisor, and the mirror signed-dividend/unsigned-divisor case) all pass; functional and style checks are green. |
|
@groeneai plese check CI failures and merge with latest master if needed. |
…dex-intdiv-monotonicity
Master PR ClickHouse#94681 (operators-as-functions) renders intDiv as the DIV operator in the new EXPLAIN plan formatter, so intDiv(a, 10.0) shows as a DIV 10. in the sort description. The two read-in-order assertions matched the literal substring Prefix sort description: intDiv, which no longer appears, flipping them to 0 in the merge queue. The WHERE explain LIKE '%Prefix sort description%' filter already isolates the prefix sort line, so count the filtered rows instead: 1 when read-in-order keeps intDiv monotonic, 0 otherwise. Rendering-agnostic, reference unchanged.
|
Merged latest master and fixed the merge-queue failure, which was our own test Root cause: master #94681 (operators-as-functions) now renders Verified on the merged tree (head aaa1cf8): the #90461 UInt64-wrap repro, Float-divisor, and mirror signed/unsigned cases all still correct; 0 failures across 15 randomized query/MergeTree setting profiles; sibling 00940/02911 references unchanged (they use |
intDiv by a Decimal constant computes in the decimal native signed width (DecimalBinaryOperation feeds both operands into DivideIntegralImpl<NativeResultType, NativeResultType>), casting the dividend into that width and pre-multiplying by the scale. A UInt64 dividend >= 2^63 reinterprets as negative there, and a signed dividend >= 2^(native_width-1) truncates/wraps too, at a boundary that depends on the decimal width and scale, not on the dividend width. The old guard gated on isInt(divisor_type), which is false for Decimal, so intDiv(key, Decimal_const) fell through to always-monotonic and key analysis built a reversed Range: Invalid binary search result in MergeTreeSetIndex in debug, silent over-pruning in release. Report intDiv by a Decimal divisor as non-monotonic in both the finite-range and null-endpoint branches. Author: Groene AI <[email protected]>
Pre-PR validation gate (click to expand) — HEAD 0860227
Robustness: 0 failures / 8 randomized query-setting profiles; deterministic (not flaky). Session id: cron:clickhouse-maint-slot-9:20260721-100001 |
divide by a Decimal constant takes the same integral-division path as intDiv: DecimalBinaryOperation substitutes DivideIntegralImpl<NativeResultType, NativeResultType> for divide as well and casts the dividend into the decimal's native signed width, so divide(UInt64, Decimal64) reinterprets a UInt64 dividend >= 2^63 as negative and is non-monotonic across that boundary exactly like intDiv. The previous guard only rejected intDiv by a Decimal divisor, so a divide by a Decimal divisor still reported always-monotonic, letting key analysis build a reversed Range and abort with Invalid binary search result in MergeTreeSetIndex (or silently over-prune in release). Widen both getMonotonicityForRange guards (finite-range and null-endpoint) to fire for divide as well as intDiv. A Float divisor is unaffected (it computes through floating point, result Float64, and stays monotonic); a Decimal dividend with an integer divisor is unaffected (only a Decimal divisor is rejected). Add divide-by-Decimal regression cases to 04340: UInt64/Decimal64 IN and NOT IN, the Int64/Decimal32 sibling, a divide-by-Float still-prunes guard, and a Decimal-dividend still-prunes guard.
Pre-PR validation gate (click to expand) - HEAD 7c528a2
Session id: cron:clickhouse-maint-slot-8:20260721-114400 |
| /// which always places `D` strictly inside. Endpoint comparison of the transformed values cannot | ||
| /// detect this because both endpoints can map to the same output while the interior jumps. | ||
| /// `arg_type` is the unsigned dividend type (already stripped of Nullable/LowCardinality). | ||
| static bool intDivRangeCrossesSignedWrap(const DataTypePtr & arg_type, const Field & left_point, const Field & right_point) |
There was a problem hiding this comment.
This helper still misses the INT_MIN / -1 exception point. For intDiv(UInt8_key, toInt16(-1)), D = 128 is not only the first reinterpreted negative value; static_cast<Int8>(128) is -128, so intDiv(128, -1) throws ILLEGAL_DIVISION. Because the guard here only rejects left < D <= right, ranges that merely touch D on the reinterpreted side still fall through as monotonic.
That becomes user-visible on open key ranges, because applyMonotonicFunctionsChainToRange ignores bound inclusiveness and applies the function to the stored endpoint value. A predicate like a > 128 AND intDiv(a, toInt16(-1)) IN (...) has the actual row domain 129..255 (fully defined), but key analysis still tries intDiv(128, -1) while transforming the open left bound and throws before scanning rows. The same corner exists in the new intDivConstReinterpretsNegative path for all-ones unsigned divisors such as toUInt8(255).
Please treat effective divisor -1 as an extra monotonicity breaker whenever the closed approximation of the range touches the reinterpreted INT_MIN point, or otherwise avoid applying excluded endpoints, and add a focused regression around a > 128 / a > -128.
There was a problem hiding this comment.
Verified on the current HEAD build. The ILLEGAL_DIVISION throw reproduces (a > 128 AND intDiv(a, toInt16(-1)) IN (0) fails at key-analysis time), but it is pre-existing on master and out of scope for this PR:
- The raw signed spelling
intDiv(Int8, toInt8(-1))hits none of this PR's guards (signed/signed falls straight through to the unchanged mastervariable / constantreturn{true, is_constant_positive, true}) and throws identically. intDiv(INT_MIN, -1)throws at runtime as well, and the same predicate on a Memory table (no key analysis) returns rows with no throw. So the defect isapplyMonotonicFunctionsChainToRangetransforming an excluded closed-range endpoint, not the monotonicity classification ingetMonotonicityForRange.
The "avoid applying excluded endpoints" fix belongs in KeyCondition; a -1-touches-INT_MIN special case here would miss the raw signed spelling and over-reject valid pruning. Tracking the pre-existing endpoint-transform bug separately rather than widening this PR.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 37/40 (92.50%) · Uncovered code |
CI finish ledger - 7c528a2CI fully finished (Finish Workflow pass; 0 checks queued/in-progress). New head (pushed today after the Decimal-divisor CR fix) since the 2026-07-03 ledger. One failure, not caused by this PR's diff (an
Session id: cron:our-pr-ci-monitor:20260721-190000 |
99b066d
…rge constant divisor intDiv and divide with a Decimal dividend compute in the decimal's own native signed width (DecimalBinaryOperation::NativeResultType) and materialise the constant divisor into that width with static_cast. For Decimal(5, 4) that width is Int32, so intDiv(a, -9223372036854775807) actually divides by 1 and increases. getMonotonicityForRange derived the direction from the untruncated literal and reported decreasing, and its only Decimal guard tested the divisor, which is the wrong operand for this shape. Key analysis then called Range::invert() on a range whose values never reversed, so left > right. For a set atom MergeTreeSetIndex::checkInRange then gets begin > end and hits its debug-only assertion, reported by the AST fuzzer as STID 3252-3a4a. For a range atom there is no assertion at all, so every matching granule is pruned away and the query silently returns wrong results in release builds too: on Decimal(5, 4) data holding 0..9, WHERE intDiv(a, -9223372036854775807) > 4 returned 0 rows where 5 match. Add one shared predicate, decimalDivConstDivisorTruncates, and call it from both variable / constant branches of getMonotonicityForRange. The second branch handles ranges with an infinite endpoint, which forAnyHyperrectangle produces routinely, so a fix applied only to the finite-endpoint branch leaves those exposed; a mutant that removes the call from the infinite branch alone still reddens two of the new test arms. The predicate is a round-trip test rather than a blanket rejection, so intDiv(decimal_col, small_const) keeps its pruning, and it is gated on an integer divisor because a Float divisor converts both operands to Float64 and stays order preserving. The defect does not depend on the literal's sign: a positive 9223372036854775807 casts to Int32 -1, so the function decreases while the claim says it increases, and that fails the same way. Both directions are covered by test arms, as are all the invariant carriers: divide as well as intDiv, both checkInRange overloads, IN and NOT IN, range atoms as well as set atoms, ascending and DESC keys, and the wider Decimal widths where the same constant survives the cast. This is the third defect of this family, after ClickHouse#107586 and ClickHouse#113048; ClickHouse#112156 fixed the mirror case of a constant dividend. Co-Authored-By: Claude Opus 5 <[email protected]>
…ndex-intdiv-monotonicity Fix false monotonicity of intDiv(unsigned, constant) causing Invalid binary search result in MergeTreeSetIndex
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a
LOGICAL_ERRORInvalid binary search result in MergeTreeSetIndex(and missed index pruning in release builds) when anIN/NOT INcondition on the primary key wraps the key inintDivby a constant and the key is an unsigned integer whose values cross the signed boundary of theintDivresult type (for exampleintDiv(uint64_column, -9223372036854775807)).Description
The
variable / constantbranch ofFunctionBinaryArithmetic::getMonotonicityForRangeclaimedintDiv(variable, constant)is always monotonic. That is incorrect when the dividend is unsigned and theintDivresult type is signed:intDivcasts the dividend to a signed computation type when the divisor is signed (seeDivideIntegralImpl), so an unsigned value>= 2^(width-1)wraps to a negative result. For exampleintDiv(UInt64, Int64-constant)has anInt64result, so a dividend>= 2^63becomes negative and the function is no longer monotonic across that boundary.When such a chain feeds an
IN/NOT INkey condition,KeyCondition::applyMonotonicFunctionsChainToRangebuilds aRangewithleft > right, andMergeTreeSetIndex::checkInRangethen violates thestd::partition_pointinvariantbegin <= end. Debug builds abort with theLOGICAL_ERROR; release builds fall back to the{true, true}BoolMask (results stay correct but the index does no pruning).This is the
variable / constantcounterpart of theconst / variablecase fixed in #103621.The fix verifies, only for the affected case (unsigned dividend with a signed
intDivresult), that the dividend->result-type cast preserves the order of[left_point, right_point]by transforming both endpoints.divide(floating-point) and every otherintDivtype combination keep their previous always-monotonic behavior, so legitimate index pruning is unchanged.Found by the AST fuzzer on master (STID 3252-3a4a). The failing query divided a
UInt64key by a large negativeInt128constant inside aGLOBAL INset.Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=c3be9310ee8c2af93f00b16941e14b900ff3796c&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_debug%29
Version info
26.7.1.1308(included in26.7and later)