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

MDEV-29771 Server crashes in check_sequence_fields upon CREATE TABLE .. SEQUENCE=1 AS SELECT ..

Pass name separately for sequence check because sequence can be created with
CREATE TABLE (see https://mariadb.com/kb/en/create-table/#sequence )
This commit is contained in:
Oleksandr Byelkin
2023-09-26 18:17:04 +02:00
parent 554aa1e2b4
commit 2d29ccda1a
5 changed files with 26 additions and 5 deletions

View File

@ -186,7 +186,8 @@ void sequence_definition::store_fields(TABLE *table)
true Failure
*/
bool check_sequence_fields(LEX *lex, List<Create_field> *fields)
bool check_sequence_fields(LEX *lex, List<Create_field> *fields,
const LEX_CSTRING db, const LEX_CSTRING table_name)
{
Create_field *field;
List_iterator_fast<Create_field> it(*fields);
@ -234,8 +235,7 @@ bool check_sequence_fields(LEX *lex, List<Create_field> *fields)
err:
my_error(ER_SEQUENCE_INVALID_TABLE_STRUCTURE, MYF(0),
lex->first_select_lex()->table_list.first->db.str,
lex->first_select_lex()->table_list.first->table_name.str, reason);
db.str, table_name.str, reason);
DBUG_RETURN(TRUE);
}