summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-05-15 11:57:40 +0300
committermonty@mysql.com <>2004-05-15 11:57:40 +0300
commite0a4b51215963a5f10f57f3949b117322dca59cb (patch)
treebc0f1775f58953cbf0e41e15b7cb5874821c8578 /mysql-test
parente81c6e1763bf0d6442c59ef17fcf61af02bf2d1f (diff)
downloadmariadb-git-e0a4b51215963a5f10f57f3949b117322dca59cb.tar.gz
Better fix for bug #3749 (bug in deleting automatic generated foreign keys)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_encrypt.result2
-rw-r--r--mysql-test/r/innodb.result31
-rw-r--r--mysql-test/t/innodb.test10
3 files changed, 42 insertions, 1 deletions
diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result
index abdfda0423f..d32e67fe7d5 100644
--- a/mysql-test/r/func_encrypt.result
+++ b/mysql-test/r/func_encrypt.result
@@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
+Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 60280715911..cb99f9fe06d 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1538,6 +1538,37 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ KEY `id` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ KEY `t1_id_fk` (`id`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL auto_increment,
+ `id2` int(11) NOT NULL default '0',
+ KEY `id_test` (`id`),
+ KEY `id_test2` (`id`,`id2`),
+ CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
ERROR HY000: Can't create table './test/t2.frm' (errno: 150)
drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index a260ab1263d..36b2914ef46 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1082,6 +1082,16 @@ create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),cons
show create table t2;
drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+drop table t2;
+
# Test error handling
--error 1005
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;