mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-16760 CREATE OR REPLACE TABLE never updates statistical tables
If the command CREATE OR REPLACE TABLE really replaces a table then it should remove all data on this table from all statistical tables.
This commit is contained in:
@ -330,3 +330,23 @@ SELECT * FROM mysql.column_stats;
|
||||
DROP TABLE t1;
|
||||
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||
--echo #
|
||||
|
||||
SET use_stat_tables= PREFERABLY;
|
||||
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||
ANALYZE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM mysql.column_stats;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
Reference in New Issue
Block a user