Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4
-
None
-
None
Description
In a per-row bulk operation (COM_STMT_BULK_EXECUTE that executes the statement once per parameter set: UPDATE, DELETE, INSERT with a subquery depending on a parameter after MDEV-23864) a reprepare in a later execution calls Prepared_statement::reprepare(), which calls thd->get_stmt_da()->clear_warning_info(). The warnings of the earlier parameter sets are dropped, but the warning count of the bulk operation still counts them.
How to repeat
SET sql_mode=''; |
CREATE TABLE t2 (a INT PRIMARY KEY, b TINYINT); |
INSERT INTO t2 VALUES (1,0),(2,0),(3,0); |
-- bulk, parameter sets (1000,1), (1,2), (1,3):
|
UPDATE t2 SET b = ? WHERE a = ?; |
-- connection 2, between parameter sets 1 and 2:
|
ALTER TABLE t2 FORCE; |
SHOW WARNINGS;
|
The client runs the bulk statement on connection 1 with SET debug_sync='before_execute_sql_command SIGNAL s1 WAIT_FOR go EXECUTE 2', and a second connection runs the DDL while the second parameter set waits (debug build). Without debug_sync the same happens when the DDL is concurrent and lands between two parameter sets.
With the MDEV-23864 patch (10.11, debug) the OK packet reports 1 warning, but SHOW WARNINGS is empty. Without the reprepare SHOW WARNINGS shows
Warning 1264 Out of range value for column 'b' at row 1
|
Without the patch (11.4.13 debug, source revision 4813c2f0a8a79e4e4c000cc8c9447096fafe7033) the server fails the assertion `! is_set() || m_can_overwrite_status' in Diagnostics_area::set_error_status() instead, see MDEV-41511.
Attachments
Issue Links
- relates to
-
MDEV-23864 BULK insert wrong values when command contain inner select
-
- Closed
-
-
MDEV-41501 Server crash in Protocol_binary::prepare_for_resend on bulk DELETE ... RETURNING after reprepare
-
- Open
-
-
MDEV-41511 Bulk DELETE ... RETURNING * sends rows that do not match the result set metadata when the table changes between parameter sets
-
- Open
-