mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
Merge tag 'mariadb-10.0.23' into 10.0-galera
This commit is contained in:
9
mysql-test/suite/innodb/r/dropdb.result
Normal file
9
mysql-test/suite/innodb/r/dropdb.result
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
|
||||
#
|
||||
set session default_storage_engine=innodb;
|
||||
create database `b`;
|
||||
use `b`;
|
||||
create table `#mysql50#q.q` select 1;
|
||||
ERROR 42000: Incorrect table name '#mysql50#q.q'
|
||||
drop database `b`;
|
||||
@@ -568,7 +568,7 @@ Variable_name Value
|
||||
auto_increment_increment 65535
|
||||
auto_increment_offset 65535
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
ERROR 22003: Out of range value for column 'c1' at row 1
|
||||
ERROR HY000: Failed to read auto-increment value from storage engine
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
@@ -642,6 +642,18 @@ PRIMARY KEY (m)) ENGINE = InnoDB;
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SELECT * FROM t2;
|
||||
m n o
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@@ -649,7 +661,7 @@ t2 CREATE TABLE `t2` (
|
||||
`n` int(10) unsigned NOT NULL,
|
||||
`o` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`m`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
|
||||
40
mysql-test/suite/innodb/r/innodb-dict.result
Normal file
40
mysql-test/suite/innodb/r/innodb-dict.result
Normal file
@@ -0,0 +1,40 @@
|
||||
CREATE TABLE t1 (D INT) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
ALTER TABLE t1 MODIFY COLUMN d INT;
|
||||
ALTER TABLE t1 ADD INDEX my_d (d);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`d` int(11) DEFAULT NULL,
|
||||
KEY `my_d` (`d`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
EXPLAIN SELECT d FROM t1 WHERE d = 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref my_d my_d 5 const 128 Using index
|
||||
EXPLAIN SELECT D FROM t1 WHERE D = 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref my_d my_d 5 const 128 Using index
|
||||
ALTER TABLE t1 DROP INDEX my_d;
|
||||
ALTER TABLE t1 MODIFY COLUMN D INT;
|
||||
ALTER TABLE t1 ADD INDEX my_d (D);
|
||||
EXPLAIN SELECT d FROM t1 WHERE d = 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref my_d my_d 5 const 128 Using index
|
||||
EXPLAIN SELECT D FROM t1 WHERE D = 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref my_d my_d 5 const 128 Using index
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`D` int(11) DEFAULT NULL,
|
||||
KEY `my_d` (`D`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
@@ -25,7 +25,7 @@ create table t2(a int, constraint a foreign key a (a) references t1(a)) engine=i
|
||||
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.
|
||||
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 near ' 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;
|
||||
@@ -42,7 +42,7 @@ 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).
|
||||
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 near ' 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;
|
||||
@@ -51,7 +51,7 @@ 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).
|
||||
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t11` not found in the data dictionary near ' 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;
|
||||
@@ -90,14 +90,14 @@ alter table t1 add constraint c1 foreign key (f1) references t1(f1) on update se
|
||||
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.
|
||||
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' near ' 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.
|
||||
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' near ' 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;
|
||||
@@ -106,7 +106,7 @@ create table t2(a char(20), key(a), foreign key(a) references t1(f1)) engine=inn
|
||||
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
|
||||
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' near '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;
|
||||
|
||||
@@ -50,8 +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.
|
||||
Warning 150 Create table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary near ' 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 (
|
||||
@@ -65,7 +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.
|
||||
Warning 150 Alter table `test`.`t2` with foreign key constraint failed. Referenced table `test`.`t3` not found in the data dictionary near ' 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;
|
||||
|
||||
71
mysql-test/suite/innodb/r/innodb-get-fk.result
Normal file
71
mysql-test/suite/innodb/r/innodb-get-fk.result
Normal file
@@ -0,0 +1,71 @@
|
||||
CREATE SCHEMA `repro`;
|
||||
CREATE TABLE `repro`.`crew` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(50) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `code` (`code`)
|
||||
) ENGINE=InnoDB;
|
||||
CREATE TABLE `repro`.`pilot` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(50) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `code` (`code`)
|
||||
) ENGINE=InnoDB;
|
||||
CREATE TABLE `repro`.`crew_role_assigned` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`crew_id` int(11) NOT NULL,
|
||||
`role_code` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
|
||||
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COMMENT="This is a comment about tables";
|
||||
# Restart mysqld --innodb_read_only_mode=1
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
Table Create Table
|
||||
crew_role_assigned CREATE TABLE `crew_role_assigned` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`crew_id` int(11) NOT NULL,
|
||||
`role_code` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
|
||||
KEY `fk_crewRoleAssigned_pilotId` (`crew_id`),
|
||||
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a comment about tables'
|
||||
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
Table Create Table
|
||||
crew_role_assigned CREATE TABLE `crew_role_assigned` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`crew_id` int(11) NOT NULL,
|
||||
`role_code` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
|
||||
KEY `fk_crewRoleAssigned_pilotId` (`crew_id`),
|
||||
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
|
||||
# Restart mysqld --innodb_read_only_mode=1
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
Table Create Table
|
||||
crew_role_assigned CREATE TABLE `crew_role_assigned` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`crew_id` int(11) NOT NULL,
|
||||
`role_code` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
|
||||
KEY `fk_crewRoleAssigned_pilotId` (`crew_id`),
|
||||
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
|
||||
DROP TABLE `repro`.`crew_role_assigned`;
|
||||
DROP TABLE `repro`.`pilot`;
|
||||
DROP TABLE `repro`.`crew`;
|
||||
DROP SCHEMA `repro`;
|
||||
@@ -0,0 +1,20 @@
|
||||
set global innodb_stats_auto_recalc=off;
|
||||
CREATE TABLE t1 (i int) ENGINE=InnoDB;
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
|
||||
test/t1 Initialized 0 0
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
|
||||
test/t1 Initialized 2 2
|
||||
DELETE FROM t1 WHERE i = 1;
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
|
||||
test/t1 Initialized 1 3
|
||||
UPDATE t1 SET i = 4 WHERE i = 2;
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
NAME STATS_INITIALIZED NUM_ROWS MODIFIED_COUNTER
|
||||
test/t1 Initialized 1 4
|
||||
DROP TABLE t1;
|
||||
set global innodb_stats_auto_recalc=default;
|
||||
@@ -2,7 +2,7 @@ SET GLOBAL innodb_file_per_table=0;
|
||||
create table bug56947(a int not null) engine = innodb;
|
||||
SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename';
|
||||
alter table bug56947 add unique index (a);
|
||||
ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB
|
||||
ERROR HY000: Got error 11 "xxx" from storage engine InnoDB
|
||||
SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename';
|
||||
check table bug56947;
|
||||
Table Op Msg_type Msg_text
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic;
|
||||
DROP TABLE t1;
|
||||
12
mysql-test/suite/innodb/t/dropdb.test
Normal file
12
mysql-test/suite/innodb/t/dropdb.test
Normal file
@@ -0,0 +1,12 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
|
||||
--echo #
|
||||
|
||||
set session default_storage_engine=innodb;
|
||||
create database `b`;
|
||||
use `b`;
|
||||
--error ER_WRONG_TABLE_NAME
|
||||
create table `#mysql50#q.q` select 1;
|
||||
drop database `b`;
|
||||
@@ -351,7 +351,7 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
--error 167
|
||||
--error 1467
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@@ -403,6 +403,7 @@ CREATE TABLE t2 (
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SELECT * FROM t2;
|
||||
SHOW CREATE TABLE t2;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
31
mysql-test/suite/innodb/t/innodb-dict.test
Normal file
31
mysql-test/suite/innodb/t/innodb-dict.test
Normal file
@@ -0,0 +1,31 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# Fix MySQL Bug#20755615: InnoDB compares column names case sensitively,
|
||||
# while according to Storage Engine API column names should be compared
|
||||
# case insensitively. This can cause FRM and InnoDB data dictionary to
|
||||
# go out of sync:
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (D INT) ENGINE=innodb;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
ALTER TABLE t1 MODIFY COLUMN d INT;
|
||||
ALTER TABLE t1 ADD INDEX my_d (d);
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
EXPLAIN SELECT d FROM t1 WHERE d = 5;
|
||||
EXPLAIN SELECT D FROM t1 WHERE D = 5;
|
||||
ALTER TABLE t1 DROP INDEX my_d;
|
||||
ALTER TABLE t1 MODIFY COLUMN D INT;
|
||||
ALTER TABLE t1 ADD INDEX my_d (D);
|
||||
EXPLAIN SELECT d FROM t1 WHERE d = 5;
|
||||
EXPLAIN SELECT D FROM t1 WHERE D = 5;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
61
mysql-test/suite/innodb/t/innodb-get-fk.test
Normal file
61
mysql-test/suite/innodb/t/innodb-get-fk.test
Normal file
@@ -0,0 +1,61 @@
|
||||
-- source include/have_innodb.inc
|
||||
# need to restart server
|
||||
-- source include/not_embedded.inc
|
||||
CREATE SCHEMA `repro`;
|
||||
|
||||
CREATE TABLE `repro`.`crew` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(50) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `code` (`code`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `repro`.`pilot` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(50) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `code` (`code`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `repro`.`crew_role_assigned` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`crew_id` int(11) NOT NULL,
|
||||
`role_code` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
|
||||
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB COMMENT="This is a comment about tables";
|
||||
|
||||
--echo # Restart mysqld --innodb_read_only_mode=1
|
||||
-- let $restart_parameters=--innodb-read-only-mode=1
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
|
||||
--echo # Restart mysqld --innodb_read_only_mode=1
|
||||
-- let $restart_parameters=--innodb-read-only-mode=1
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
#
|
||||
# Below create table should contain also fk definitions
|
||||
#
|
||||
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
|
||||
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
DROP TABLE `repro`.`crew_role_assigned`;
|
||||
DROP TABLE `repro`.`pilot`;
|
||||
DROP TABLE `repro`.`crew`;
|
||||
DROP SCHEMA `repro`;
|
||||
@@ -0,0 +1 @@
|
||||
--loose-innodb-sys-tablestats
|
||||
28
mysql-test/suite/innodb/t/innodb-stats-modified-counter.test
Normal file
28
mysql-test/suite/innodb/t/innodb-stats-modified-counter.test
Normal file
@@ -0,0 +1,28 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# MDEV-8297: information_schema.innodb_sys_tablestats.modified_counter doesn't change on UPDATE
|
||||
#
|
||||
|
||||
set global innodb_stats_auto_recalc=off;
|
||||
|
||||
CREATE TABLE t1 (i int) ENGINE=InnoDB;
|
||||
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
|
||||
DELETE FROM t1 WHERE i = 1;
|
||||
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
|
||||
UPDATE t1 SET i = 4 WHERE i = 2;
|
||||
|
||||
SELECT NAME, STATS_INITIALIZED, NUM_ROWS, MODIFIED_COUNTER FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
set global innodb_stats_auto_recalc=default;
|
||||
@@ -8,6 +8,7 @@ SET GLOBAL innodb_file_per_table=0;
|
||||
create table bug56947(a int not null) engine = innodb;
|
||||
|
||||
SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename';
|
||||
--replace_regex /"[^"]*"/"xxx"/
|
||||
--error ER_GET_ERRNO
|
||||
alter table bug56947 add unique index (a);
|
||||
SET DEBUG_DBUG='-d,ib_rebuild_cannot_rename';
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--loose-innodb_trx
|
||||
--loose-innodb_locks
|
||||
--loose-innodb_lock_waits
|
||||
--loose-innodb_cmp
|
||||
--loose-innodb_cmp_reset
|
||||
--loose-innodb_cmp_per_index
|
||||
--loose-innodb_cmp_per_index_reset
|
||||
--loose-innodb_cmpmem
|
||||
--loose-innodb_cmpmem_reset
|
||||
--loose-innodb_buffer_page
|
||||
--loose-innodb_buffer_page_lru
|
||||
--loose-innodb_buffer_stats
|
||||
--loose-innodb_sys_tables
|
||||
--loose-innodb_sys_tablestats
|
||||
--loose-innodb_sys_indexes
|
||||
--loose-innodb_sys_columns
|
||||
--loose-innodb_sys_fields
|
||||
--loose-innodb_sys_foreign
|
||||
--loose-innodb_sys_foreign_cols
|
||||
--loose-innodb_changed_pages
|
||||
--loose-innodb_rseg
|
||||
--loose-innodb_undo_logs
|
||||
--loose-innodb_sys_stats
|
||||
--loose-innodb_table_stats
|
||||
--loose-innodb_index_stats
|
||||
--loose-innodb_admin_command
|
||||
--loose-innodb_buffer_pool_pages
|
||||
--loose-innodb_buffer_pool_pages_index
|
||||
--loose-innodb_buffer_pool_pages_blob
|
||||
@@ -0,0 +1,64 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730
|
||||
#
|
||||
# Make sure that all supported information_schema tables are readable
|
||||
# (actual result sets are not important).
|
||||
#
|
||||
CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
BEGIN;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_RESET;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_STATS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_RSEG;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_UNDO_LOGS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_STATS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLE_STATS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEX_STATS;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_ADMIN_COMMAND;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_INDEX;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_PAGES_BLOB;
|
||||
--error 0,1109
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
|
||||
COMMIT;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
DROP TABLE t1;
|
||||
Reference in New Issue
Block a user