Bug #108259 Prepared statement with values list assertion error
Submitted: 23 Aug 2022 17:11 Modified: 24 Aug 2022 17:11
Reporter: Pedro Ferreira Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S6 (Debug Builds)
Version: 8.0.30 OS:Ubuntu (22.04.1)
Assigned to: CPU Architecture:x86 (x86_x64)
Tags: prepared statement

[23 Aug 2022 17:11] Pedro Ferreira
Description:
Run the following queries:

CREATE TABLE t0 (c0 INT);
PREPARE p0 FROM 'WITH t0 AS (VALUES ROW(1),ROW(?)) UPDATE t0 SET c0 = 1';

The prepared statement will trigger an assertion error in field.cc:1241

assert(a != MYSQL_TYPE_INVALID && b != MYSQL_TYPE_INVALID);

The prepared statement should be created successfully. The parameter should be set to the same type as the first-row value.

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.
[24 Aug 2022 5:58] MySQL Verification Team
Hello Pedro Ferreira,

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

regards,
Umesh
[24 Aug 2022 17:11] Pedro Ferreira
A simplified version of the query:

PREPARE p1 FROM 'VALUES ROW(1),ROW(?)';