diff options
Diffstat (limited to 'mysql-test/main/update_innodb.result')
-rw-r--r-- | mysql-test/main/update_innodb.result | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/main/update_innodb.result b/mysql-test/main/update_innodb.result index 695561122f0..beab54833d1 100644 --- a/mysql-test/main/update_innodb.result +++ b/mysql-test/main/update_innodb.result @@ -89,3 +89,57 @@ update t1, t2 set a=NULL, b=2, c=NULL where b=d and e=200; drop table t1,t2; set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set @@use_stat_tables= @save_use_stat_tables; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY) engine=innodb; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +BEGIN; +SELECT * FROM t1 UNION +SELECT * FROM t2 FOR UPDATE; +a +1 +2 +connect con2,localhost,root,,; +BEGIN; +SELECT * FROM t2 FOR UPDATE;; +connection default; +select * from t2; +a +2 +update t2 set a=a+100; +commit; +connection con2; +a +102 +commit; +connection default; +drop table t1,t2; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) engine=innodb; +CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY) engine=innodb; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +BEGIN; +SELECT * FROM ( +SELECT * FROM t1 UNION +SELECT * FROM t2 FOR UPDATE +) t; +a +1 +2 +connection con2; +BEGIN; +SELECT * FROM t2 FOR UPDATE;; +connection default; +select * from t2; +a +2 +update t2 set a=a+100; +commit; +connection con2; +a +102 +commit; +connection default; +disconnect con2; +drop table t1,t2; +# End of 10.4 tests |