Bug #111955 Prepared statement with CTE assertion error
Submitted: 3 Aug 2023 9:14 Modified: 24 Aug 2023 21:54
Reporter: Pedro Ferreira Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Prepared statements Severity:S6 (Debug Builds)
Version:8.1.0, 8.0.34 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: cte, prepare statement

[3 Aug 2023 9:14] Pedro Ferreira
Description:
Run this query:

PREPARE p0 FROM 'WITH x(x) AS (WITH y(y) AS (SELECT ?) SELECT 1 FROM y WHERE y.y) SELECT 1 FROM x JOIN x y';

It will hit an assertion error at sql/item.cc:3789
assert(false);

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 query above.
[3 Aug 2023 10:28] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.
Observed that 8.0.34 debug build is affected.

regards,
Umesh
[24 Aug 2023 21:54] Jon Stephens
Documented fix as follows in the MySQL 8.2.0 changelog:

    Execution of a prepared statement containing one or more common
    table expressions led to an assertion in debug builds.

Closed.