From 8ea80ecfeb88846ee47c65011eb9ff7eddab84b3 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Tue, 22 Sep 2015 06:21:13 +0200 Subject: Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE Note: Backporting the patch from mysql-5.6. Problem: A CREATE TABLE with an invalid table name is detected at SQL layer. So the table name is reset to an empty string. But the storage engine is called with this empty table name. The table name is specified as "database/table". So, in the given scenario we get only "database/". Solution: Within InnoDB, detect this error and report it to higher layer. rb#9274 approved by jimmy. --- mysql-test/suite/innodb/r/dropdb.result | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mysql-test/suite/innodb/r/dropdb.result (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/dropdb.result b/mysql-test/suite/innodb/r/dropdb.result new file mode 100644 index 00000000000..f8890784bfc --- /dev/null +++ b/mysql-test/suite/innodb/r/dropdb.result @@ -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 HY000: Can't create table 'b.#mysql50#q.q' (errno: 1103) +drop database `b`; -- cgit v1.2.1 From c3018b0ff4fb02c029787d03867adf0530607bab Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 29 Nov 2015 17:51:23 +0200 Subject: Fixes to get all test to run on MacosX Lion 10.7 This includes fixing all utilities to not have any memory leaks, as safemalloc warnings stopped tests from passing on MacOSX. - Ensure that all clients takes character-set-dir, as the libmysqlclient library will use it. - mysql-test-run now passes character-set-dir to all external clients. - Changed dynstr_free() so that it can be called twice (made freeing code easier) - Changed rpl_global_gtid_slave_state to be allocated dynamicly as it includes a mutex that needs to be initizlied/destroyed before my_end() is called. - Removed rpl_slave_state::init() and rpl_slave_stage::deinit() as their job are better handling by constructor and delete. - Print alias instead of table_name in check_duplicate_key as table_name may have been converted to lower case. Other things: - Fixed a case in time_to_datetime_with_warn() where we where using && instead of & in tests --- mysql-test/suite/innodb/r/innodb_bug56947.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result index 54af78047dd..878450144a2 100644 --- a/mysql-test/suite/innodb/r/innodb_bug56947.result +++ b/mysql-test/suite/innodb/r/innodb_bug56947.result @@ -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 -- cgit v1.2.1 From 33589b25efe3283b748e43a54c42db2ed176c3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 3 Dec 2015 13:18:10 +0200 Subject: MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730 Analysis: debug only assertion I_S function (IS is XtraDB feature) is calling buf_block_get_frame on any page it reads, which debug-asserts that the page is buffer-fixed, which is not the case in I_S query. Fixed by holding the buffer page mutex while the fields are read directly. --- mysql-test/suite/innodb/r/innodb_information_schema_tables.result | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_information_schema_tables.result (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb_information_schema_tables.result b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result new file mode 100644 index 00000000000..ea713ea6f6a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_information_schema_tables.result @@ -0,0 +1,2 @@ +CREATE TABLE t1 ENGINE=InnoDB AS SELECT * FROM mysql.help_topic; +DROP TABLE t1; -- cgit v1.2.1 From c8652eefe50fd1894f2e2360e8bd631a7b9c67f5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 5 Dec 2015 11:22:25 +0100 Subject: one more test --- mysql-test/suite/innodb/r/innodb-autoinc.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 6a232cf434e..d6f7a930340 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -641,6 +641,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` ( -- cgit v1.2.1 From ef47b62551b0f37770e5d174ea028150c5b71fd8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 5 Dec 2015 11:29:00 +0100 Subject: MDEV-8827 Duplicate key with auto increment fix innodb auto-increment handling three bugs: 1. innobase_next_autoinc treated the case of current Date: Fri, 11 Dec 2015 14:33:41 +0200 Subject: MDEV-9251: 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. --- mysql-test/suite/innodb/r/innodb-dict.result | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb-dict.result (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb-dict.result b/mysql-test/suite/innodb/r/innodb-dict.result new file mode 100644 index 00000000000..e3b2f0d5288 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-dict.result @@ -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; -- cgit v1.2.1 From 99404c3437b35b5ee51578c2ea74209ccb9ba890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 14 Dec 2015 14:34:32 +0200 Subject: MDEV-9276: MySQL Bug #78754: FK definitions missing from SHOW CREATE TABLE in "innodb_read_only" mode --- mysql-test/suite/innodb/r/innodb-get-fk.result | 71 ++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb-get-fk.result (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb-get-fk.result b/mysql-test/suite/innodb/r/innodb-get-fk.result new file mode 100644 index 00000000000..0dca82c2d10 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-get-fk.result @@ -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`; -- cgit v1.2.1 From 98c9fbfa215242f2930990a0a80b9c5642d23e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 15 Dec 2015 11:27:08 +0200 Subject: MDEV-8297: information_schema.innodb_sys_tablestats.modified_counter doesn't change on UPDATE Update modified-counter also if update effects non-indexed columns. --- .../innodb/r/innodb-stats-modified-counter.result | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb-stats-modified-counter.result (limited to 'mysql-test/suite/innodb/r') diff --git a/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result b/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result new file mode 100644 index 00000000000..db56c6ba81a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-stats-modified-counter.result @@ -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; -- cgit v1.2.1