diff options
author | Michael Widenius <monty@mariadb.org> | 2018-04-05 15:16:20 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2018-04-05 15:17:41 +0300 |
commit | d8da97b09abec8fba2398f6ff6d84285b0752400 (patch) | |
tree | 0e06e5ca37561ebfcc74e0ede13d9378c643fbc0 /sql | |
parent | 3dd01669b41bfad75f4a785d6263eb0f729b0213 (diff) | |
download | mariadb-git-d8da97b09abec8fba2398f6ff6d84285b0752400.tar.gz |
MDEV-14762 Server crashes in MDL_ticket::has_stronger_or_equal_type upon inserting into temporary sequence
Fix is to not upgrade MDL locks for temporary tables
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_sequence.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index 93f6f32d473..b500ce3c1f6 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -237,9 +237,12 @@ int ha_sequence::write_row(uchar *buf) THD *thd= table->in_use; if (thd->lock->table_count != 1) DBUG_RETURN(ER_WRONG_INSERT_INTO_SEQUENCE); - if (thd->mdl_context.upgrade_shared_lock(table->mdl_ticket, MDL_EXCLUSIVE, - thd->variables.lock_wait_timeout)) - DBUG_RETURN(ER_LOCK_WAIT_TIMEOUT); + if (table->s->tmp_table == NO_TMP_TABLE && + thd->mdl_context.upgrade_shared_lock(table->mdl_ticket, + MDL_EXCLUSIVE, + thd->variables. + lock_wait_timeout)) + DBUG_RETURN(ER_LOCK_WAIT_TIMEOUT); tmp_seq.read_fields(table); if (tmp_seq.check_and_adjust(0)) |