Browse Source
Merge from mysql-5.1-innodb:
Merge from mysql-5.1-innodb:
------------------------------------------------------------ revno: 3449 revision-id: marko.makela@oracle.com-20100505104425-39y6qbffgotrhck2 parent: marko.makela@oracle.com-20100505104001-883pqiepo384qr5h committer: Marko Mäkelä <marko.makela@oracle.com> branch nick: 5.1-innodb timestamp: Wed 2010-05-05 13:44:25 +0300 message: Factor out innodb_multi_update.test from innodb.testpull/374/head
5 changed files with 119 additions and 105 deletions
-
80mysql-test/suite/innodb/r/innodb.result
-
76mysql-test/suite/innodb/r/innodb_multi_update.result
-
12mysql-test/suite/innodb/t/disabled.def
-
27mysql-test/suite/innodb/t/innodb.test
-
29mysql-test/suite/innodb/t/innodb_multi_update.test
@ -0,0 +1,76 @@ |
|||||
|
CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; |
||||
|
CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; |
||||
|
INSERT INTO bug38999_1 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 bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; |
||||
|
select * from bug38999_1; |
||||
|
a b |
||||
|
101 1 |
||||
|
102 2 |
||||
|
103 3 |
||||
|
104 4 |
||||
|
105 5 |
||||
|
106 6 |
||||
|
107 7 |
||||
|
108 8 |
||||
|
109 9 |
||||
|
110 10 |
||||
|
111 11 |
||||
|
112 12 |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; |
||||
|
select * from bug38999_1; |
||||
|
a b |
||||
|
201 1 |
||||
|
102 2 |
||||
|
103 3 |
||||
|
104 4 |
||||
|
105 5 |
||||
|
106 6 |
||||
|
107 7 |
||||
|
108 8 |
||||
|
109 9 |
||||
|
110 10 |
||||
|
111 11 |
||||
|
112 12 |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; |
||||
|
select * from bug38999_1; |
||||
|
a b |
||||
|
201 1 |
||||
|
103 3 |
||||
|
104 4 |
||||
|
105 5 |
||||
|
106 6 |
||||
|
107 7 |
||||
|
108 8 |
||||
|
109 9 |
||||
|
110 10 |
||||
|
111 11 |
||||
|
102 12 |
||||
|
112 12 |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; |
||||
|
select * from bug38999_1; |
||||
|
a b |
||||
|
201 1 |
||||
|
103 5 |
||||
|
104 6 |
||||
|
106 6 |
||||
|
105 7 |
||||
|
107 7 |
||||
|
108 8 |
||||
|
109 9 |
||||
|
110 10 |
||||
|
111 11 |
||||
|
102 12 |
||||
|
112 12 |
||||
|
select * from bug38999_2; |
||||
|
a b |
||||
|
1 1 |
||||
|
2 2 |
||||
|
6 6 |
||||
|
7 7 |
||||
|
8 8 |
||||
|
9 9 |
||||
|
3 13 |
||||
|
4 14 |
||||
|
5 15 |
||||
|
drop table bug38999_1,bug38999_2; |
||||
@ -0,0 +1,12 @@ |
|||||
|
############################################################################## |
||||
|
# |
||||
|
# List the test cases that are to be disabled temporarily. |
||||
|
# |
||||
|
# Separate the test case name and the comment with ':'. |
||||
|
# |
||||
|
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment> |
||||
|
# |
||||
|
# Do not use any TAB characters for whitespace. |
||||
|
# |
||||
|
############################################################################## |
||||
|
innodb_multi_update: Bug #38999 2010-05-05 mmakela Valgrind warnings |
||||
@ -0,0 +1,29 @@ |
|||||
|
-- source include/have_innodb.inc |
||||
|
|
||||
|
# |
||||
|
# Test multi update with different join methods |
||||
|
# |
||||
|
|
||||
|
CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb; |
||||
|
CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb; |
||||
|
INSERT INTO bug38999_1 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 bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); |
||||
|
|
||||
|
# Full join, without key |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100; |
||||
|
select * from bug38999_1; |
||||
|
|
||||
|
# unique key |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101; |
||||
|
select * from bug38999_1; |
||||
|
|
||||
|
# ref key |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2; |
||||
|
select * from bug38999_1; |
||||
|
|
||||
|
# Range key (in bug38999_1) |
||||
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100; |
||||
|
select * from bug38999_1; |
||||
|
select * from bug38999_2; |
||||
|
|
||||
|
drop table bug38999_1,bug38999_2; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue