~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test Bug #57255. Cascade deletes that affect different rows should not
 
2
# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
 
3
 
 
4
--source include/have_innodb.inc
 
5
 
 
6
create table A(id int not null primary key) engine=innodb;
 
7
 
 
8
create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
 
9
 
 
10
create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
 
11
 
 
12
insert into A values(1), (2);
 
13
 
 
14
--disable_query_log
 
15
begin;
 
16
let $i=257;
 
17
while ($i)
 
18
{
 
19
insert into B(f1) values(1);
 
20
dec $i;
 
21
}
 
22
let $i=486;
 
23
while ($i)
 
24
{
 
25
insert into C(f1) values(2);
 
26
dec $i;
 
27
}
 
28
commit;
 
29
--enable_query_log
 
30
 
 
31
# Following Deletes should not report error
 
32
DELETE FROM A where id = 1;
 
33
DELETE FROM C where f1 = 2;
 
34
DELETE FROM A where id = 1;
 
35
 
 
36
DROP TABLE C;
 
37
DROP TABLE B;
 
38
DROP TABLE A;