Bug #111383 Scale assertion error
Submitted: 13 Jun 2023 4:44 Modified: 13 Jun 2023 7:16
Reporter: Pedro Ferreira Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S6 (Debug Builds)
Version:8.0.33 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: avg, NULLIF, precision, scale

[13 Jun 2023 4:44] Pedro Ferreira
Description:
Run these queries:

CREATE TABLE t0 (c0 YEAR);
SELECT avg(nullif(t0.c0, t0.c0)) FROM t0;

The select query will trigger an assertion error at strings/decimal.cc:1625
assert(scale >= 0 && precision > 0 && scale <= precision);

The compilation parameters are the same as issue 108148:

-DWITH_DEBUG=1 -DWITH_ASAN=ON -DWITH_UBSAN=ON and boost library version 1.77

How to repeat:
Run the queries above.
[13 Jun 2023 7:16] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.
Verified as described.

regards,
Umesh