diff options
author | Michael Widenius <monty@askmonty.org> | 2010-11-23 23:39:59 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-11-23 23:39:59 +0200 |
commit | b52020221e8b4e58d1bc6dd5a5a6f065a6a3a083 (patch) | |
tree | 6068b9d90b4127b1c3608e29913fa82bf1a1f20e /mysql-test/suite/innodb | |
parent | 7840965db9460e2117c163f3db83aaa247c65203 (diff) | |
parent | 498ee6bd19eabc85dcbd9abebc9cf6aeb79d1985 (diff) | |
download | mariadb-git-b52020221e8b4e58d1bc6dd5a5a6f065a6a3a083.tar.gz |
Merge with MySQL 5.1.52
Diffstat (limited to 'mysql-test/suite/innodb')
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_bug56716.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_bug57255.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_mysql.result | 20 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug53756.test | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug56716.test | 10 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug57255.test | 36 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_mysql.test | 18 |
7 files changed, 100 insertions, 2 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_bug56716.result b/mysql-test/suite/innodb/r/innodb_bug56716.result new file mode 100644 index 00000000000..50d83e8d87a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug56716.result @@ -0,0 +1,4 @@ +CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB; +SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE; +a b c +DROP TABLE bug56716; diff --git a/mysql-test/suite/innodb/r/innodb_bug57255.result b/mysql-test/suite/innodb/r/innodb_bug57255.result new file mode 100644 index 00000000000..d61a0d42ba3 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug57255.result @@ -0,0 +1,10 @@ +create table A(id int not null primary key) engine=innodb; +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; +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; +insert into A values(1), (2); +DELETE FROM A where id = 1; +DELETE FROM C where f1 = 2; +DELETE FROM A where id = 1; +DROP TABLE C; +DROP TABLE B; +DROP TABLE A; diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 12ff0ae8ac6..5d90a96f61c 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -2608,3 +2608,23 @@ Extra Using index DROP TABLE t1; # End of 5.1 tests +# +# Test for bug #39932 "create table fails if column for FK is in different +# case than in corr index". +# +drop tables if exists t1, t2; +create table t1 (pk int primary key) engine=InnoDB; +# Even although the below statement uses uppercased field names in +# foreign key definition it still should be able to find explicitly +# created supporting index. So it should succeed and should not +# create any additional supporting indexes. +create table t2 (fk int, key x (fk), +constraint x foreign key (FK) references t1 (PK)) engine=InnoDB; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fk` int(11) DEFAULT NULL, + KEY `x` (`fk`), + CONSTRAINT `x` FOREIGN KEY (`fk`) REFERENCES `t1` (`pk`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index 8324f2640a2..d3b0a77c680 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -34,8 +34,8 @@ INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44); --echo --echo # Select a less restrictive isolation level. # Don't use user variables. They won't survive server crash. ---let $global_isolation= `SELECT @@global.tx_isolation`; ---let $session_isolation= `SELECT @@session.tx_isolation`; +--let $global_isolation= `SELECT @@global.tx_isolation` +--let $session_isolation= `SELECT @@session.tx_isolation` SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; COMMIT; diff --git a/mysql-test/suite/innodb/t/innodb_bug56716.test b/mysql-test/suite/innodb/t/innodb_bug56716.test new file mode 100644 index 00000000000..3345038d9c1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug56716.test @@ -0,0 +1,10 @@ +# +# Bug #56716 InnoDB locks a record gap without locking the table +# +-- source include/have_innodb.inc + +CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB; + +SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE; + +DROP TABLE bug56716; diff --git a/mysql-test/suite/innodb/t/innodb_bug57255.test b/mysql-test/suite/innodb/t/innodb_bug57255.test new file mode 100644 index 00000000000..2b37a0a6092 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug57255.test @@ -0,0 +1,36 @@ +# Test Bug #57255. Cascade deletes that affect different rows should not +# result in DB_FOREIGN_EXCEED_MAX_CASCADE error + +--source include/have_innodb.inc + +create table A(id int not null primary key) engine=innodb; + +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; + +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; + +insert into A values(1), (2); + +--disable_query_log +let $i=257; +while ($i) +{ +insert into B(f1) values(1); +dec $i; +} +let $i=486; +while ($i) +{ +insert into C(f1) values(2); +dec $i; +} +--enable_query_log + +# Following Deletes should not report error +DELETE FROM A where id = 1; +DELETE FROM C where f1 = 2; +DELETE FROM A where id = 1; + +DROP TABLE C; +DROP TABLE B; +DROP TABLE A; diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test index e346d91aaa4..991440e54dd 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql.test +++ b/mysql-test/suite/innodb/t/innodb_mysql.test @@ -844,3 +844,21 @@ DROP TABLE t1; --echo End of 5.1 tests + + +--echo # +--echo # Test for bug #39932 "create table fails if column for FK is in different +--echo # case than in corr index". +--echo # +--disable_warnings +drop tables if exists t1, t2; +--enable_warnings +create table t1 (pk int primary key) engine=InnoDB; +--echo # Even although the below statement uses uppercased field names in +--echo # foreign key definition it still should be able to find explicitly +--echo # created supporting index. So it should succeed and should not +--echo # create any additional supporting indexes. +create table t2 (fk int, key x (fk), + constraint x foreign key (FK) references t1 (PK)) engine=InnoDB; +show create table t2; +drop table t2, t1; |