mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#46958: Assertion in Diagnostics_area::set_ok_status,
trigger, merge table The problem with break statements is that they have very local effects. Hence a break statement within the inner loop of a nested-loops join caused execution to proceed to the next table even though a serious error occurred. The problem was fixed by breaking out the inner loop into its own method. The change empowers all errors to terminate the execution. The errors that will now halt multi-DELETE execution altogether are - triggers returning errors - handler errors - server being killed mysql-test/r/delete.result: Bug#46958: Test result. mysql-test/t/delete.test: Bug#46958: Test case. sql/sql_class.h: Bug#46958: New method declaration. sql/sql_delete.cc: Bug#46958: New method implementation.
This commit is contained in:
@ -292,3 +292,47 @@ DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
|
||||
--echo # merge table
|
||||
--echo #
|
||||
CREATE TABLE t1 ( a INT );
|
||||
CREATE TABLE t2 ( a INT );
|
||||
CREATE TABLE t3 ( a INT );
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
INSERT INTO t3 VALUES (1), (2);
|
||||
|
||||
CREATE TRIGGER tr1 BEFORE DELETE ON t2
|
||||
FOR EACH ROW INSERT INTO no_such_table VALUES (1);
|
||||
|
||||
--error ER_NO_SUCH_TABLE
|
||||
DELETE t1, t2, t3 FROM t1, t2, t3;
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t3;
|
||||
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
CREATE TABLE t1 ( a INT );
|
||||
CREATE TABLE t2 ( a INT );
|
||||
CREATE TABLE t3 ( a INT );
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
INSERT INTO t3 VALUES (1), (2);
|
||||
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t2
|
||||
FOR EACH ROW INSERT INTO no_such_table VALUES (1);
|
||||
|
||||
--error ER_NO_SUCH_TABLE
|
||||
DELETE t1, t2, t3 FROM t1, t2, t3;
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t3;
|
||||
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
Reference in New Issue
Block a user