summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2018-04-05 15:16:20 +0300
committerMichael Widenius <monty@mariadb.org>2018-04-05 15:17:41 +0300
commitd8da97b09abec8fba2398f6ff6d84285b0752400 (patch)
tree0e06e5ca37561ebfcc74e0ede13d9378c643fbc0 /sql
parent3dd01669b41bfad75f4a785d6263eb0f729b0213 (diff)
downloadmariadb-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.cc9
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))