mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Factor out innodb_multi_update.test from innodb.test
This commit is contained in:
@ -915,33 +915,6 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
|
||||
SELECT * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test multi update with different join methods
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
||||
CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
||||
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
|
||||
INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
|
||||
|
||||
# Full join, without key
|
||||
update t1,t2 set t1.a=t1.a+100;
|
||||
select * from t1;
|
||||
|
||||
# unique key
|
||||
update t1,t2 set t1.a=t1.a+100 where t1.a=101;
|
||||
select * from t1;
|
||||
|
||||
# ref key
|
||||
update t1,t2 set t1.b=t1.b+10 where t1.b=2;
|
||||
select * from t1;
|
||||
|
||||
# Range key (in t1)
|
||||
update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
|
||||
CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=0;
|
||||
|
Reference in New Issue
Block a user