Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4
-
None
-
None
Description
Bulk INSERT ... RETURNING (COM_STMT_BULK_EXECUTE) into a table with a BEFORE INSERT trigger which executes DML fails an assertion in debug builds.
How to repeat
CREATE TABLE t3 (id INT, val INT); |
CREATE TABLE t3log (v INT); |
CREATE TRIGGER t3_bi BEFORE INSERT ON t3 FOR EACH ROW |
INSERT INTO t3log VALUES (NEW.val); |
-- bulk, parameter sets (1,10), (2,20), (3,30):
|
INSERT INTO t3 VALUES (?, ?) RETURNING id, val; |
Reproduced on 10.11 (10.11.19 debug) and 11.4 (11.4.13 debug, source revision 4813c2f0a8a79e4e4c000cc8c9447096fafe7033):
sql_error.cc:386: void Diagnostics_area::set_eof_status(THD*): Assertion `!is_set() || (m_status == DA_EOF_BULK && is_bulk_op())' failed.
|
sql/sql_class.h:6025(my_eof(THD*))
|
sql/sql_class.cc:3256(select_send::send_eof())
|
sql/sql_insert.cc:1448(mysql_insert(...))
|
The statements of the trigger reset the diagnostics area, which in bulk mode gets DA_OK_BULK, and send_eof() then expects DA_EOF_BULK.
Related: MDEV-24411 (triggers with bulk insert).
Attachments
Issue Links
- relates to
-
MDEV-23864 BULK insert wrong values when command contain inner select
-
- Closed
-
-
MDEV-24411 Trigger doesn't work correctly with bulk insert
-
- Closed
-