~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/innodb_multi_update.test

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-21 15:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100621153105-pbbz3t6nyrf9t2zq
Tags: upstream-5.1.48
ImportĀ upstreamĀ versionĀ 5.1.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_innodb.inc
 
2
 
 
3
#
 
4
# Test multi update with different join methods
 
5
#
 
6
 
 
7
CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb;
 
8
CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb;
 
9
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);
 
10
INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
 
11
 
 
12
# Full join, without key
 
13
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100;
 
14
select * from bug38999_1;
 
15
 
 
16
# unique key
 
17
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101;
 
18
select * from bug38999_1;
 
19
 
 
20
# ref key
 
21
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2;
 
22
select * from bug38999_1;
 
23
 
 
24
# Range key (in bug38999_1)
 
25
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;
 
26
select * from bug38999_1;
 
27
select * from bug38999_2;
 
28
 
 
29
drop table bug38999_1,bug38999_2;