summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/r')
-rw-r--r--mysql-test/suite/innodb/r/add_constraint.result13
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-table.result45
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-timestamp.result29
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk-warnings.result112
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_uninstall.result22
7 files changed, 225 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/add_constraint.result b/mysql-test/suite/innodb/r/add_constraint.result
new file mode 100644
index 00000000000..798e87a3761
--- /dev/null
+++ b/mysql-test/suite/innodb/r/add_constraint.result
@@ -0,0 +1,13 @@
+#
+# Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE
+#
+create table t1(a int, b int, key(a),key(b))engine=innodb;
+create table t2(a int, b int, key(a),key(b))engine=innodb;
+alter table t2 add constraint b foreign key (b) references t1(a);
+alter table t1 add constraint b1 foreign key (b) references t2(a);
+alter table t2 add constraint b1 foreign key (b) references t1(a);
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update")
+alter table t2 drop foreign key b;
+alter table t1 drop foreign key b1;
+drop table t2;
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-table.result b/mysql-test/suite/innodb/r/innodb-alter-table.result
new file mode 100644
index 00000000000..2c76a2640e0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-table.result
@@ -0,0 +1,45 @@
+drop database if exists moodle19;
+Warnings:
+Note 1008 Can't drop database 'moodle19'; database doesn't exist
+create database moodle19;
+use moodle19;
+CREATE TABLE `mdl_course_modules` (
+`id` bigint(10) NOT NULL AUTO_INCREMENT,
+`course` bigint(10) NOT NULL DEFAULT '0',
+`module` bigint(10) NOT NULL DEFAULT '0',
+`instance` bigint(10) NOT NULL DEFAULT '0',
+`section` bigint(10) NOT NULL DEFAULT '0',
+`idnumber` varchar(100) DEFAULT NULL,
+`added` bigint(10) NOT NULL DEFAULT '0',
+`delay` varchar(10) NOT NULL DEFAULT '0',
+`score` smallint(4) NOT NULL DEFAULT '0',
+`indent` mediumint(5) NOT NULL DEFAULT '0',
+`visible` tinyint(1) NOT NULL DEFAULT '1',
+`checkboxesforprereqs` tinyint(1) NOT NULL DEFAULT '0',
+`stylewhencomplete` varchar(200) DEFAULT '',
+`checkboxforcomplete` tinyint(1) NOT NULL DEFAULT '0',
+`stylewhenlocked` varchar(200) DEFAULT 'locked',
+`visiblewhenlocked` tinyint(1) NOT NULL DEFAULT '1',
+`visibleold` tinyint(1) NOT NULL DEFAULT '1',
+`groupmode` smallint(4) NOT NULL DEFAULT '0',
+`groupingid` bigint(10) NOT NULL DEFAULT '0',
+`groupmembersonly` smallint(4) NOT NULL DEFAULT '0',
+`completion` tinyint(1) NOT NULL DEFAULT '0',
+`completiongradeitemnumber` bigint(10) DEFAULT NULL,
+`completionview` tinyint(1) NOT NULL DEFAULT '0',
+`completionexpected` bigint(10) NOT NULL DEFAULT '0',
+`availablefrom` bigint(10) NOT NULL DEFAULT '0',
+`availableuntil` bigint(10) NOT NULL DEFAULT '0',
+`showavailability` tinyint(1) NOT NULL DEFAULT '0',
+`showdescription` tinyint(1) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `mdl_courmodu_vis_ix` (`visible`),
+KEY `mdl_courmodu_cou_ix` (`course`),
+KEY `mdl_courmodu_mod_ix` (`module`),
+KEY `mdl_courmodu_ins_ix` (`instance`),
+KEY `mdl_courmodu_idncou_ix` (`idnumber`,`course`),
+KEY `mdl_courmodu_gro_ix` (`groupingid`)
+) ENGINE=InnoDB AUTO_INCREMENT=447023 DEFAULT CHARSET=utf8 COMMENT='course_modules table retrofitted from MySQL';
+# Inserting 2701 rows into the table...
+ALTER TABLE moodle19.mdl_course_modules ADD stefantest LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci AFTER showdescription;
+drop database moodle19;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
new file mode 100644
index 00000000000..2ab81136d1f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
@@ -0,0 +1,29 @@
+CREATE TABLE t1 (
+`i1` INT(10) UNSIGNED NOT NULL,
+`d1` TIMESTAMP NULL DEFAULT NULL
+) ENGINE=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i1` int(10) unsigned NOT NULL,
+ `d1` timestamp NULL DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 (i1) VALUES (1), (2), (3), (4), (5);
+select * from t1;
+i1 d1
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+set sql_mode = 'STRICT_ALL_TABLES,NO_ZERO_DATE';
+ALTER TABLE t1 CHANGE `d1` `d1` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;
+drop table t1;
+CREATE TABLE t1 (
+`i1` INT(10) UNSIGNED NOT NULL,
+`d1` TIMESTAMP NULL DEFAULT NULL
+) ENGINE=innodb;
+INSERT INTO t1 (i1) VALUES (1), (2), (3), (4), (5);
+ALTER TABLE t1 CHANGE `d1` `d1` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
+drop table t1;
+set sql_mode = '';
diff --git a/mysql-test/suite/innodb/r/innodb-fk-warnings.result b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
new file mode 100644
index 00000000000..a022f07936c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
@@ -0,0 +1,112 @@
+CREATE TABLE t1 (
+id int(11) NOT NULL PRIMARY KEY,
+a int(11) NOT NULL,
+b int(11) NOT NULL,
+c int not null,
+CONSTRAINT test FOREIGN KEY (b) REFERENCES t1 (id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE TABLE t2 (
+id int(11) NOT NULL PRIMARY KEY,
+a int(11) NOT NULL,
+b int(11) NOT NULL,
+c int not null,
+CONSTRAINT mytest FOREIGN KEY (c) REFERENCES t1(id),
+CONSTRAINT test FOREIGN KEY (b) REFERENCES t2 (id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
+show warnings;
+Level Code Message
+Warning 121 Create or Alter table `test`.`t2` with foreign key constraint failed. Foreign key constraint `test/test` already exists on data dictionary. Foreign key constraint names need to be unique in database. Error in foreign key definition: CONSTRAINT `test` FOREIGN KEY (`b`) REFERENCES `test`.`t2` (`id`).
+Error 1005 Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
+Warning 1022 Can't write; duplicate key in table 't2'
+drop table t1;
+create table t1(a int) engine=innodb;
+create table t2(a int, constraint a foreign key a (a) references t1(a)) engine=innodb;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Create table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. Error close to foreign key a (a) references t1(a)) engine=innodb.
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t1;
+create table t1(a int not null primary key, b int) engine=innodb;
+create table t2(a int, b int, constraint a foreign key a (a) references t1(a),
+constraint a foreign key a (a) references t1(b)) engine=innodb;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+create table t2(a int, b int, constraint a foreign key a (a) references t1(a)) engine=innodb;
+alter table t2 add constraint b foreign key (b) references t2(b);
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Alter table '`test`.`t2`' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns. Error close to foreign key (b) references t2(b).
+Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t2, t1;
+create table t1 (f1 integer primary key) engine=innodb;
+alter table t1 add constraint c1 foreign key (f1) references t11(f1);
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t11` not found in the data dictionary close to foreign key (f1) references t11(f1).
+Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t1;
+create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
+create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Create table `mysqld.1`.`t2` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(a) references t1(a)) engine=innodb.
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+alter table t1 add foreign key(b) references t1(a);
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(b) references t1(a).
+Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t1;
+create table t1(a int not null primary key, b int, key(b)) engine=innodb;
+alter table t1 add foreign key(a,b) references t1(a);
+ERROR 42000: Incorrect foreign key definition for 'foreign key without name': Key reference and table reference don't match
+show warnings;
+Level Code Message
+Error 1239 Incorrect foreign key definition for 'foreign key without name': Key reference and table reference don't match
+drop table t1;
+create table t1(a int not null primary key, b int, key(b)) engine=innodb;
+alter table t1 add foreign key(a) references t1(a,b);
+ERROR 42000: Incorrect foreign key definition for 'foreign key without name': Key reference and table reference don't match
+show warnings;
+Level Code Message
+Error 1239 Incorrect foreign key definition for 'foreign key without name': Key reference and table reference don't match
+drop table t1;
+create table t1 (f1 integer not null primary key) engine=innodb;
+alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update set null;
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Alter table `test`.`t1` with foreign key constraint failed. You have defined a SET NULL condition but column f1 is defined as NOT NULL in foreign key (f1) references t1(f1) on update set null close to on update set null.
+Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+create table t2(a int not null, foreign key(a) references t1(f1) on delete set null) engine=innodb;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Create table `test`.`t2` with foreign key constraint failed. You have defined a SET NULL condition but column a is defined as NOT NULL in foreign key(a) references t1(f1) on delete set null) engine=innodb close to on delete set null) engine=innodb.
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t1;
+create table t1 (id int not null primary key, f1 int, f2 int, key(f1)) engine=innodb;
+create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=innodb;
+ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+show warnings;
+Level Code Message
+Warning 150 Create table `test`.`t2` with foreign key constraint failed. Field type or character set for column a does not mach referenced column f1 close to foreign key(a) references t1(f1)) engine=innodb
+Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
+Warning 1215 Cannot add foreign key constraint
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result
index 956dbce58ed..dee20d282f7 100644
--- a/mysql-test/suite/innodb/r/innodb-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-fk.result
@@ -50,6 +50,8 @@ CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
show warnings;
Level Code Message
+Warning 150 Create table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary close to FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE
+) ENGINE=InnoDB.
Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
Warning 1215 Cannot add foreign key constraint
CREATE TABLE t2 (
@@ -63,6 +65,7 @@ ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
show warnings;
Level Code Message
+Warning 150 Alter table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary close to FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE.
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
Warning 1215 Cannot add foreign key constraint
drop table t2;
diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
index cb7a3b9c282..1cb2cf77050 100644
--- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
+++ b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures.result
@@ -5,4 +5,4 @@ CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(m
SET GLOBAL innodb_simulate_comp_failures = 25;
SELECT COUNT(*) FROM t1;
COUNT(*)
-100000
+10000
diff --git a/mysql-test/suite/innodb/r/innodb_uninstall.result b/mysql-test/suite/innodb/r/innodb_uninstall.result
new file mode 100644
index 00000000000..2064269a02e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_uninstall.result
@@ -0,0 +1,22 @@
+install plugin innodb soname 'ha_innodb';
+create table t1(a int not null primary key) engine=innodb;
+begin;
+insert into t1 values(1);
+flush tables;
+uninstall plugin innodb;
+select sleep(1);
+sleep(1)
+0
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+drop table t1;
+install plugin innodb soname 'ha_innodb';
+create table t2(a int not null primary key) engine=innodb;
+insert into t2 values(1);
+drop table t2;
+uninstall plugin innodb;
+select sleep(1);
+sleep(1)
+0
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown