Bug #108369 Prepared statement assertion error
Submitted: 2 Sep 14:08 Modified: 2 Sep 14:41
Reporter: Pedro Ferreira Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version: 8.0.30 OS:Ubuntu (22.04.1)
Assigned to: CPU Architecture:x86 (x86_x64)
Tags: prepared, row

[2 Sep 14:08] Pedro Ferreira
Description:
Run the following statement:

SELECT (VALUES ROW(1.0, 1.0),ROW(1, b'1')) < (VALUES ROW(1.0, 1.0));

It will trigger the assertion at sql/item.cc:10473

assert(false);

I expect a single false value as the output.

The compilation parameters are the same as issue 108148:

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

I am going to leave a side comment. The query above was reduced from this:

PREPARE p0 FROM 'SELECT 5';
SET @a0 = ((VALUES ROW(1.0, 1.0),ROW(1, b'1')) < (VALUES ROW(1.0, 1.0)));
EXECUTE p0 USING @a0;

In this case, the prepared statement doesn't have any parameters, so I would expect an error by a mismatch in the number of parameters. Instead, the server is attempting to evaluate the parameters before the check, which I find unnecessary.

How to repeat:
Run the query above.
[2 Sep 14:41] MySQL Verification Team
Hello Pedro Ferreira,

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

regards,
Umesh