Skip to content

Commit 18de4df

Browse files
author
Mattias Jonsson
committed
WL#4443
Added handling of insert/update with triggers. Cannot prune INSERT/REPLACE when having BEFORE INSERT trigger. Cannot prune UPDATE(locks)/INSERT ON DUPLICATE KEY UPDATE when having BEFORE UPDATE trigger.
1 parent 2fc3995 commit 18de4df

9 files changed

+2397
-608
lines changed

mysql-test/include/commit.inc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,7 @@ call p_verify_status_increment(4, 4, 4, 4);
750750
--echo #
751751
--echo # Sic: no table is created.
752752
create table if not exists t2 (a int) select 6 union select 7;
753-
--echo # Sic: first commits the statement, and then the transaction.
754-
--echo # TODO: verify this before WL#4443 is complete!!!
755-
#call p_verify_status_increment(2, 0, 2, 0);
753+
--echo # No table are locked before existing t2 is found, so nothing to commit.
756754
call p_verify_status_increment(0, 0, 0, 0);
757755
create table t3 select a from t2;
758756
call p_verify_status_increment(2, 0, 4, 4);

mysql-test/r/commit_1innodb.result

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,7 @@ SUCCESS
827827
create table if not exists t2 (a int) select 6 union select 7;
828828
Warnings:
829829
Note 1050 Table 't2' already exists
830-
# Sic: first commits the statement, and then the transaction.
831-
# TODO: verify this before WL#4443 is complete!!!
830+
# No table are locked before existing t2 is found, so nothing to commit.
832831
call p_verify_status_increment(0, 0, 0, 0);
833832
SUCCESS
834833

mysql-test/r/explain.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ PREPARE s FROM
449449
'EXPLAIN EXTENDED
450450
SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
451451
FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
452+
# After WL#4443 we don't evaluate subqueries during prepare, so no error.
452453
EXECUTE s;
453454
id select_type table type possible_keys key key_len ref rows filtered Extra
454455
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where

0 commit comments

Comments
 (0)