summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2004-02-22 10:04:08 +0200
committerunknown <monty@mashka.mysql.fi>2004-02-22 10:04:08 +0200
commit54cefbab0f80629e9f29468f47664da064812c4e (patch)
treebb4a0959d03a40cc4edc02b97239c982e8b8bed3 /mysql-test
parent192bf819eb2bb91e383327d3bde6f596c20a82db (diff)
parent2100d85c4feac93aae349ca5666e638dba3ea807 (diff)
downloadmariadb-git-54cefbab0f80629e9f29468f47664da064812c4e.tar.gz
Merge with 4.0 to get fixed tests
mysql-test/t/lock_tables_lost_commit.test: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/innodb.result13
-rw-r--r--mysql-test/r/multi_update.result13
-rw-r--r--mysql-test/t/innodb.test18
-rw-r--r--mysql-test/t/lock_tables_lost_commit.test2
-rw-r--r--mysql-test/t/multi_update.test13
5 files changed, 33 insertions, 26 deletions
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 57ad5ef79a2..66115c79b5f 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1332,6 +1332,19 @@ drop table t1;
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
drop table t2,t1;
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Unknown table 't1' in where clause
+drop table t3,t2,t1;
CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
(stamp))ENGINE=InnoDB;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 0ceb6cbfaed..a61ce31b8ae 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -373,19 +373,6 @@ where 0=1;
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
-create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb;
-insert into `t1`values ( 1 ) ;
-create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
-insert into `t2`values ( 1 ) ;
-create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
-insert into `t3`values ( 1 ) ;
-delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-Cannot delete or update a parent row: a foreign key constraint fails
-update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-Cannot delete or update a parent row: a foreign key constraint fails
-update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-Unknown table 't1' in where clause
-drop table t3,t2,t1;
create table t1 ( a int not null, b int not null) ;
alter table t1 add index i1(a);
delete from t1 where a > 2000000;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index f931b4bb798..5602a57905b 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -942,6 +942,24 @@ CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN K
drop table t2,t1;
#
+# Test of multi updated and foreign keys
+#
+
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+--error 1217
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1217
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1109
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+drop table t3,t2,t1;
+
+#
# Test timestamps
#
diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test
index 22b666cbc86..8c1ad97c0cc 100644
--- a/mysql-test/t/lock_tables_lost_commit.test
+++ b/mysql-test/t/lock_tables_lost_commit.test
@@ -1,5 +1,7 @@
# This is a test for bug 578
+-- source include/have_innodb.inc
+
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 4cb6218e0c4..eb77734300f 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -309,19 +309,6 @@ delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
-create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb;
-insert into `t1`values ( 1 ) ;
-create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
-insert into `t2`values ( 1 ) ;
-create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
-insert into `t3`values ( 1 ) ;
---error 1217
-delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
---error 1217
-update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
---error 1109
-update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
-drop table t3,t2,t1;
#
# Test for bug #1820.