mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#32430: 'show innodb status' causes errors
Invalid (old?) table or database name in logs Problem was still not completely fixed, due to qouting. This is the server side only fix (in explain_filename), the change from filename_to_tablename to use explain_filename in the InnoDB code must be done before the bug is fixed. mysql-test/include/have_not_innodb_plugin.inc: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs Added include file to allow test for only the 'old' built-in innodb engine mysql-test/r/not_true.require: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs Added require to match 'not' TRUE mysql-test/r/partition_innodb_builtin.result: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs New result file for partitioning specific to the 'old' built-in innodb engine mysql-test/r/partition_innodb_plugin.result: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs New result file for partitioning specific to the new plugin innodb engine mysql-test/t/disabled.def: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs Disabling the new test until the fix is included in the InnoDB source too. mysql-test/t/partition_innodb_builtin.test: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs New test file for partitioning specific to the 'old' built-in innodb engine mysql-test/t/partition_innodb_plugin.test: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs New test file for partitioning specific to the new plugin innodb engine sql/mysql_priv.h: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs Added thd as a parameter to explain_filename to be able to use the correct quote character sql/sql_table.cc: Bug#32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs Changed explain_filename, so that it does qouting correctly according to the sessions qoute char.
This commit is contained in:
4
mysql-test/include/have_not_innodb_plugin.inc
Normal file
4
mysql-test/include/have_not_innodb_plugin.inc
Normal file
@ -0,0 +1,4 @@
|
||||
disable_query_log;
|
||||
--require r/not_true.require
|
||||
select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
|
||||
enable_query_log;
|
2
mysql-test/r/not_true.require
Normal file
2
mysql-test/r/not_true.require
Normal file
@ -0,0 +1,2 @@
|
||||
TRUE
|
||||
NULL
|
39
mysql-test/r/partition_innodb_builtin.result
Normal file
39
mysql-test/r/partition_innodb_builtin.result
Normal file
@ -0,0 +1,39 @@
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
|
||||
ENGINE=InnoDB
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION `p0``\""e` VALUES LESS THAN (100)
|
||||
(SUBPARTITION `sp0``\""e`,
|
||||
SUBPARTITION `sp1``\""e`),
|
||||
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
|
||||
(SUBPARTITION `sp2``\""e`,
|
||||
SUBPARTITION `sp3``\""e`));
|
||||
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
|
||||
START TRANSACTION;
|
||||
# con1
|
||||
SET NAMES utf8;
|
||||
START TRANSACTION;
|
||||
# default connection
|
||||
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
|
||||
# con1
|
||||
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
|
||||
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
|
||||
# default connection
|
||||
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
# First table reported in 'SHOW ENGINE InnoDB STATUS'
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
Type Name Status
|
||||
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
Type Name Status
|
||||
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
# con1
|
||||
ROLLBACK;
|
||||
# default connection
|
||||
DROP TABLE `t``\""e`;
|
||||
SET NAMES DEFAULT;
|
50
mysql-test/r/partition_innodb_plugin.result
Normal file
50
mysql-test/r/partition_innodb_plugin.result
Normal file
@ -0,0 +1,50 @@
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
|
||||
ENGINE=InnoDB
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION `p0``\""e` VALUES LESS THAN (100)
|
||||
(SUBPARTITION `sp0``\""e`,
|
||||
SUBPARTITION `sp1``\""e`),
|
||||
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
|
||||
(SUBPARTITION `sp2``\""e`,
|
||||
SUBPARTITION `sp3``\""e`));
|
||||
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
|
||||
START TRANSACTION;
|
||||
# con1
|
||||
SET NAMES utf8;
|
||||
START TRANSACTION;
|
||||
# default connection
|
||||
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
|
||||
# con1
|
||||
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
|
||||
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
|
||||
# default connection
|
||||
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
|
||||
GROUP BY lock_table;
|
||||
lock_table COUNT(*)
|
||||
`test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ 2
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
|
||||
GROUP BY lock_table;
|
||||
lock_table COUNT(*)
|
||||
"test"."t`\""""e" /* Partition "p0`\""""e", Subpartition "sp0`\""""e" */ 2
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
# First table reported in 'SHOW ENGINE InnoDB STATUS'
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
Type Name Status
|
||||
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
Type Name Status
|
||||
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
# con1
|
||||
ROLLBACK;
|
||||
# default connection
|
||||
DROP TABLE `t``\""e`;
|
||||
SET NAMES DEFAULT;
|
@ -13,4 +13,5 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be
|
||||
innodb_bug39438 : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently"
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
init_connect : Bug#44920 2009-07-06 pcrews MTR not processing master.opt input properly on Windows. *Must be done this way due to the nature of the bug*
|
||||
|
||||
partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
|
||||
partition_innodb_plugin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
|
||||
|
67
mysql-test/t/partition_innodb_builtin.test
Normal file
67
mysql-test/t/partition_innodb_builtin.test
Normal file
@ -0,0 +1,67 @@
|
||||
--source include/have_partition.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_not_innodb_plugin.inc
|
||||
|
||||
#
|
||||
# Bug#32430 - show engine innodb status causes errors
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
|
||||
ENGINE=InnoDB
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION `p0``\""e` VALUES LESS THAN (100)
|
||||
(SUBPARTITION `sp0``\""e`,
|
||||
SUBPARTITION `sp1``\""e`),
|
||||
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
|
||||
(SUBPARTITION `sp2``\""e`,
|
||||
SUBPARTITION `sp3``\""e`));
|
||||
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
|
||||
START TRANSACTION;
|
||||
--echo # con1
|
||||
connect(con1,localhost,root,,);
|
||||
SET NAMES utf8;
|
||||
START TRANSACTION;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
|
||||
--echo # con1
|
||||
connection con1;
|
||||
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
|
||||
let $id_1= `SELECT CONNECTION_ID()`;
|
||||
SEND;
|
||||
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
let $wait_timeout= 2;
|
||||
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE ID = $id_1 AND STATE = 'Searching rows for update';
|
||||
--source include/wait_condition.inc
|
||||
#--echo # tested wait condition $wait_condition_reps times
|
||||
--error ER_LOCK_DEADLOCK
|
||||
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
|
||||
--echo # First table reported in 'SHOW ENGINE InnoDB STATUS'
|
||||
# RECORD LOCKS space id 0 page no 50 n bits 80 index `PRIMARY` in \
|
||||
# Database `test`, Table `t1`, Partition `p0`, Subpartition `sp0` \
|
||||
# trx id 0 775
|
||||
# NOTE: replace_regex is very slow on match copy/past '(.*)' regex's
|
||||
# on big texts, removing a lot of text before + after makes it much faster.
|
||||
#/.*in (.*) trx.*/\1/
|
||||
--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
# INNODB_LOCKS only exists in innodb_plugin
|
||||
#SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
|
||||
--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
--echo # con1
|
||||
connection con1;
|
||||
REAP;
|
||||
ROLLBACK;
|
||||
disconnect con1;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
DROP TABLE `t``\""e`;
|
||||
SET NAMES DEFAULT;
|
75
mysql-test/t/partition_innodb_plugin.test
Normal file
75
mysql-test/t/partition_innodb_plugin.test
Normal file
@ -0,0 +1,75 @@
|
||||
--source include/have_partition.inc
|
||||
--source include/have_innodb.inc
|
||||
--source suite/innodb/include/have_innodb_plugin.inc
|
||||
|
||||
#
|
||||
# Bug#32430 - show engine innodb status causes errors
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
|
||||
ENGINE=InnoDB
|
||||
PARTITION BY RANGE (a)
|
||||
SUBPARTITION BY HASH (a)
|
||||
(PARTITION `p0``\""e` VALUES LESS THAN (100)
|
||||
(SUBPARTITION `sp0``\""e`,
|
||||
SUBPARTITION `sp1``\""e`),
|
||||
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
|
||||
(SUBPARTITION `sp2``\""e`,
|
||||
SUBPARTITION `sp3``\""e`));
|
||||
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
|
||||
START TRANSACTION;
|
||||
--echo # con1
|
||||
connect(con1,localhost,root,,);
|
||||
SET NAMES utf8;
|
||||
START TRANSACTION;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
|
||||
--echo # con1
|
||||
connection con1;
|
||||
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
|
||||
let $id_1= `SELECT CONNECTION_ID()`;
|
||||
SEND;
|
||||
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
let $wait_timeout= 2;
|
||||
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE ID = $id_1 AND STATE = 'Searching rows for update';
|
||||
--source include/wait_condition.inc
|
||||
#--echo # tested wait condition $wait_condition_reps times
|
||||
# INNODB_LOCKS only exists in innodb_plugin
|
||||
--sorted_result
|
||||
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
|
||||
GROUP BY lock_table;
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
--sorted_result
|
||||
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
|
||||
GROUP BY lock_table;
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
--error ER_LOCK_DEADLOCK
|
||||
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
|
||||
--echo # First table reported in 'SHOW ENGINE InnoDB STATUS'
|
||||
# RECORD LOCKS space id 0 page no 50 n bits 80 index `PRIMARY` in \
|
||||
# Database `test`, Table `t1`, Partition `p0`, Subpartition `sp0` \
|
||||
# trx id 0 775
|
||||
# NOTE: replace_regex is very slow on match copy/past '(.*)' regex's
|
||||
# on big texts, removing a lot of text before + after makes it much faster.
|
||||
#/.*in (.*) trx.*/\1/
|
||||
--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
set @old_sql_mode = @@sql_mode;
|
||||
set sql_mode = 'ANSI_QUOTES';
|
||||
--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
set @@sql_mode = @old_sql_mode;
|
||||
--echo # con1
|
||||
connection con1;
|
||||
REAP;
|
||||
ROLLBACK;
|
||||
disconnect con1;
|
||||
--echo # default connection
|
||||
connection default;
|
||||
DROP TABLE `t``\""e`;
|
||||
SET NAMES DEFAULT;
|
Reference in New Issue
Block a user