mariadb/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
Marko Mäkelä 8833c24c61 Revert MDEV-29566
This reverts commit bdc5548cad
that introduced a work-around to ha_innobase::delete_table()
for avoiding failures when trying to remove table partitions.

This work-around (of not removing statistics in case of a locking
conflict) would occasionally cause a failure of the test
parts.part_supported_sql_func_innodb:

mysqltest: In included file "./suite/parts/inc/partition_supported_sql_funcs.inc":
included from ./suite/parts/inc/part_supported_sql_funcs_main.inc at line 91:
included from /buildbot/amd64-ubuntu-2004-msan/build/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test at line 44:
At line 234: query 'alter table t66
reorganize partition s1 into
(partition p0 values less than ($valsqlfunc),
partition p1 values less than maxvalue)' failed: ER_DUP_KEY (1022): Can't write; duplicate key in table 'mysql.innodb_table_stats'
2022-09-27 10:30:49 +03:00

74 lines
2.5 KiB
Text

CREATE DATABASE unlocked;
CREATE TABLE unlocked.t1(a INT PRIMARY KEY) ENGINE=INNODB STATS_PERSISTENT=0;
CREATE DATABASE locked;
CREATE TABLE locked.t1(a INT PRIMARY KEY) ENGINE=INNODB STATS_PERSISTENT=1;
CREATE TABLE innodb_stats_drop_locked (c INT, KEY c_key (c))
ENGINE=INNODB STATS_PERSISTENT=1;
ANALYZE TABLE innodb_stats_drop_locked;
Table Op Msg_type Msg_text
test.innodb_stats_drop_locked analyze status Engine-independent statistics collected
test.innodb_stats_drop_locked analyze status OK
BEGIN;
SELECT table_name FROM mysql.innodb_table_stats
WHERE table_name='innodb_stats_drop_locked'
FOR UPDATE;
table_name
innodb_stats_drop_locked
SELECT table_name FROM mysql.innodb_index_stats
WHERE table_name='innodb_stats_drop_locked'
FOR UPDATE;
table_name
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
connect con1,localhost,root,,;
SET innodb_lock_wait_timeout=1;
ALTER TABLE innodb_stats_drop_locked DROP INDEX c_key;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE innodb_stats_drop_locked;
Table Create Table
innodb_stats_drop_locked CREATE TABLE `innodb_stats_drop_locked` (
`c` int(11) DEFAULT NULL,
KEY `c_key` (`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci STATS_PERSISTENT=1
DROP TABLE innodb_stats_drop_locked;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
DROP DATABASE unlocked;
DROP DATABASE locked;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
COMMIT;
DROP DATABASE locked;
SELECT table_name FROM mysql.innodb_table_stats
WHERE table_name='innodb_stats_drop_locked';
table_name
innodb_stats_drop_locked
SELECT table_name FROM mysql.innodb_index_stats
WHERE table_name='innodb_stats_drop_locked';
table_name
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
ALTER TABLE innodb_stats_drop_locked DROP INDEX c_key;
SELECT table_name FROM mysql.innodb_index_stats
WHERE table_name='innodb_stats_drop_locked';
table_name
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
DROP TABLE innodb_stats_drop_locked;
SELECT table_name FROM mysql.innodb_table_stats
WHERE table_name='innodb_stats_drop_locked';
table_name
SELECT table_name FROM mysql.innodb_index_stats
WHERE table_name='innodb_stats_drop_locked';
table_name