1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-5743 Server crashes in mysql_alter_table on an attempt to add a primary key to InnoDB table

This commit is contained in:
Sergei Golubchik
2014-04-07 21:53:19 +02:00
parent e82a82eef8
commit 5f0c98c17b
3 changed files with 21 additions and 1 deletions

View File

@ -6908,7 +6908,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (is_PK(key_info))
{
merged[0]= key_info[0];
if (is_PK(table->key_info))
if (table->key_info && is_PK(table->key_info))
{
old_cnt--;
table->key_info++;