diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2017-12-22 12:50:44 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2017-12-22 12:51:48 +0300 |
commit | 1e8eae40ce6a97ead39d3a8267fad27501d0995e (patch) | |
tree | 58cef620189bb63c235b0c3e27e3175814d98a8b /sql/partition_info.cc | |
parent | d6b68b0e8db29fb3bd95fc7fd99a9cdbcaf35f01 (diff) | |
download | mariadb-git-1e8eae40ce6a97ead39d3a8267fad27501d0995e.tar.gz |
MDEV-14740 Locking assertion for system_time partitioning
Assertion `thd->locked_tables_mode <= LTM_LOCK_TABLES ||
!thd->lex->requires_prelocking()' failed in lock_tables().
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index ec6cebcafb8..98f83209874 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -1035,18 +1035,20 @@ class Table_locker { THD *thd; TABLE &table; - thr_lock_type saved_mode; - TABLE_LIST table_list; + thr_lock_type saved_type; MYSQL_LOCK *saved_lock; + enum_locked_tables_mode saved_mode; + TABLE_LIST table_list; bool locked; public: Table_locker(THD *_thd, TABLE &_table, thr_lock_type lock_type) : thd(_thd), table(_table), - saved_mode(table.reginfo.lock_type), - table_list(_table, lock_type), + saved_type(table.reginfo.lock_type), saved_lock(_thd->lock), + saved_mode(_thd->locked_tables_mode), + table_list(_table, lock_type), locked(false) { table.reginfo.lock_type= lock_type; @@ -1066,8 +1068,9 @@ public: { if (locked) mysql_unlock_tables(thd, thd->lock); - table.reginfo.lock_type= saved_mode; + table.reginfo.lock_type= saved_type; thd->lock= saved_lock; + thd->locked_tables_mode= saved_mode; if (locked && !thd->in_sub_stmt) ha_commit_trans(thd, false); } |