1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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

@ -4770,6 +4770,10 @@ int create_table_impl(THD *thd,
{
if (options.or_replace())
{
LEX_STRING db_name= {(char *) db, strlen(db)};
LEX_STRING tab_name= {(char *) table_name, strlen(table_name)};
(void) delete_statistics_for_table(thd, &db_name, &tab_name);
TABLE_LIST table_list;
table_list.init_one_table(db, strlen(db), table_name,
strlen(table_name), table_name,