Bug #113248 Execute alter table heap-use-after-free
Submitted: 28 Nov 2023 10:57 Modified: 29 Nov 2023 8:50
Reporter: Pedro Ferreira Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Prepared statements Severity:S6 (Debug Builds)
Version:8.2.0, 8.0.35 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: ALTER TABLE, execute, prepare statement

[28 Nov 2023 10:57] Pedro Ferreira
Description:
Run these statements:

CREATE TABLE t0 (c0 INT);
CREATE TABLE t1 (c0 INT, c1 INT);
CREATE VIEW v2 (c0) AS (SELECT 2 FROM t1 WHERE 1 IN (SELECT 1 FROM t0 GROUP BY t1.c0 HAVING t1.c1 IS NULL));
PREPARE p0 FROM 'ALTER TABLE t0 MAX_ROWS = 1';
EXECUTE p0;
EXECUTE p0;

The address sanitizer reports a heap-use-after-free at sql/table.h:3114

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 statements above.
[28 Nov 2023 12:02] Pedro Ferreira
Fixed title
[29 Nov 2023 8:50] MySQL Verification Team
Hello Pedro Ferreira,

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

regards,
Umesh