summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-04-02 12:40:02 +0300
committerMonty <monty@mariadb.org>2018-04-02 12:42:48 +0300
commit7d2e283562f8c8c0ee060f4010f96de80fef6748 (patch)
tree0fd75c2826d3cf3bbc0d3f01d09671fdda345969 /sql/lock.cc
parent19bb7fdcd6e68aca6e41a2e30ffb3c2ad1d14cb6 (diff)
downloadmariadb-git-7d2e283562f8c8c0ee060f4010f96de80fef6748.tar.gz
Fix for MDEV-14831
MDEV-14831 CREATE OR REPLACE SEQUENCE under LOCK TABLE corrupts the sequence, causes ER_KEY_NOT_FOUND The problem was that sequence_insert didn't properly handle the case where there where there was a LOCK TABLE while creating the sequence. Fixed by opening the sequence table, for inserting the first record, in a new environment without any other open tables. Found also a bug in Locked_tables_list::reopen_tables() where the lock structure for the new tables was allocated in THD::mem_root, which causes crashes. This could cause problems with other create tables done under LOCK TABLES.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 864e9f76293..2d9409fc7c3 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -747,6 +747,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
- GET_LOCK_UNLOCK : If we should send TL_IGNORE to store lock
- GET_LOCK_STORE_LOCKS : Store lock info in TABLE
- GET_LOCK_SKIP_SEQUENCES : Ignore sequences (for temporary unlock)
+ - GET_LOCK_ON_THD : Store lock in thd->mem_root
*/
MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, uint flags)