1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-13020 Server crashes in Item_func_nextval::val_int...

The problem was that we didn't check on open of sequence if the table is a view, which is not allowed.
We are now generating a proper error message for this case.
This commit is contained in:
Monty
2017-07-06 10:59:45 +03:00
parent 58dd72f18c
commit 3f32743294
3 changed files with 62 additions and 3 deletions

View File

@ -1783,7 +1783,11 @@ retry_share:
my_error(ER_WRONG_MRG_TABLE, MYF(0));
goto err_lock;
}
if (table_list->sequence)
{
my_error(ER_NOT_SEQUENCE, MYF(0), table_list->db, table_list->alias);
goto err_lock;
}
/*
This table is a view. Validate its metadata version: in particular,
that it was a view when the statement was prepared.
@ -1936,8 +1940,8 @@ retry_share:
#endif
if (table_list->sequence && table->s->table_type != TABLE_TYPE_SEQUENCE)
{
my_error(ER_NOT_SEQUENCE, MYF(0), table_list->db, table_list->alias);
DBUG_RETURN(true);
my_error(ER_NOT_SEQUENCE, MYF(0), table_list->db, table_list->alias);
DBUG_RETURN(true);
}
table->init(thd, table_list);