1
0
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:
Igor Babaev
2018-07-13 23:03:57 -07:00
parent 095dc81158
commit ae0eb507bd
4 changed files with 74 additions and 0 deletions

View File

@ -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;