diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2017-10-14 17:31:57 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-10-22 20:30:57 +0300 |
commit | 1355fadb59693ba0ecbf544b9ff23083e610c8f7 (patch) | |
tree | fb826a0416e622a6a407cc14e41fc5393207d2b0 /sql | |
parent | eea07f5f5845c2fa5009546f6c1ed703f17a60b9 (diff) | |
download | mariadb-git-1355fadb59693ba0ecbf544b9ff23083e610c8f7.tar.gz |
MDEV-13720 Server crashes in SEQUENCE::write_lock for temporary tables
This happens when doing NEXT VALUE for a temporary table
Fixed by giving ER_NOT_SEQUENCE when trying to use normal temporary table with
sequence functions
Signed-off-by: Monty <monty@mariadb.org>
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 1a9f7ba6ebf..9c5fc23af8e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3341,6 +3341,11 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, temporary table or SEQUENCE (see sequence_insert()). */ DBUG_ASSERT(is_temporary_table(tables) || tables->table->s->sequence); + if (tables->sequence && tables->table->s->table_type != TABLE_TYPE_SEQUENCE) + { + my_error(ER_NOT_SEQUENCE, MYF(0), tables->db, tables->alias); + DBUG_RETURN(true); + } } else if (tables->open_type == OT_TEMPORARY_ONLY) { |