mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-34207: ALTER TABLE...STATS_PERSISTENT=0 fails to drop statistics
commit_try_norebuild(): If the STATS_PERSISTENT attribute of the table is being changed to disabled, drop the persistent statistics of the table.
This commit is contained in:
@ -80,5 +80,29 @@ SELECT TIMESTAMPDIFF(DAY,last_update,now())<=1 FROM mysql.innodb_index_stats
|
||||
WHERE database_name='test' AND table_name='t1' AND stat_name='size';
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-34207: ALTER TABLE...STATS_PERSISTENT=0 fails to drop statistics
|
||||
--echo #
|
||||
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB STATS_PERSISTENT 1;
|
||||
ALTER TABLE t1 STATS_PERSISTENT 0;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET @save_persistent=@@GLOBAL.innodb_stats_persistent;
|
||||
SET GLOBAL innodb_stats_persistent=1;
|
||||
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=InnoDB;
|
||||
RENAME TABLE t2 TO t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_stats_persistent=0;
|
||||
|
||||
CREATE TABLE t2 (c1 INT) ENGINE=InnoDB STATS_PERSISTENT 1;
|
||||
RENAME TABLE t2 TO t1;
|
||||
|
||||
SET GLOBAL innodb_stats_persistent=@save_persistent;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB STATS_PERSISTENT 1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
Reference in New Issue
Block a user