1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-32449 Server crashes in Alter_info::add_stat_drop_index upon CREATE TABLE

Fixed missing initialization of Alter_info()

This could cause crashes in some create table like scenarios
where some generated indexes where automatically dropped.

I also added a test that we do not try to drop from index_stats for
temporary tables.
This commit is contained in:
Monty
2023-10-14 15:46:29 +03:00
parent ec277a70e8
commit 1c554459b3
4 changed files with 48 additions and 1 deletions

View File

@@ -2898,7 +2898,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_iterator.rewind();
while ((key=key_iterator++))
{
if (key->type == Key::IGNORE_KEY)
if (key->type == Key::IGNORE_KEY && !create_info->tmp_table())
{
/* The key was replaced by another key */
if (alter_info->add_stat_drop_index(thd, &key->name))