◐ Shell
clean mode source ↗

Remove Databend bug19738 workaround after upstream fix by mrigger · Pull Request #1335 · sqlancer/sqlancer

Filed as databendlabs/databend#19773. The narrow AVG-only fix in
databendlabs/databend#19740 left several related shapes still broken on
v1.2.900-nightly, all in the eager-aggregation rewrite path:

  1. SUM(decimal_literal) over a cross join inside UNION ALL with an
     outer aggregate fails with
     `failed to downcast column Decimal128(...) into ... CoreDecimal<i64>`.

  2. Plain SUM(decimal_literal) over an N-table cross join fails with
     `assertion left == right ... Decimal precision: 38 vs 18` once the
     SUM result is wide enough to be promoted to Decimal128. The
     original report (#19738) claimed SUM did not trigger the bug; it
     does, just at higher cardinalities than AVG does.

  3. Outer SUM over UNION ALL of inner COUNTs fails with
     `unable to cast `NULL` to type `UInt64` ... CAST(_eager_final_count
     (#N) AS UInt64)`.

Suppress all three narrowly via distinctive substrings rather than
reinstating the broad `UnwindError` / `unable to cast `NULL`` matches
the previous commit removed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@mrigger mrigger deleted the fix/databend-remove-bug19738-workaround branch

April 27, 2026 15:58