summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-10 16:38:03 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-10 16:38:03 +0300
commite14d58f9783d0ab3f9564276f14901bf1016a5c1 (patch)
tree346d8f2c3b094d6d5039273eacd18e4a8028daf1 /sql/lock.cc
parent1cfcd2d210b8a069496571d3d35bf3b8bd5ee67e (diff)
downloadmariadb-git-e14d58f9783d0ab3f9564276f14901bf1016a5c1.tar.gz
Backport a part of Monty's fix for Bug#39396, rev. 2736.2.11
"ha_maria.cc:2415: assertion in ha_maria::store_lock()".
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index b64f7b0b44c..bd91494f174 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -168,9 +168,8 @@ int mysql_lock_tables_check(THD *thd, TABLE **tables, uint count, uint flags)
DBUG_RETURN(0);
}
-
/**
- Reset lock type in lock data and free.
+ Reset lock type in lock data
@param mysql_lock Lock structures to reset.
@@ -328,6 +327,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
}
else if (rc == 1) /* aborted or killed */
{
+ /*
+ reset_lock_data is required here. If thr_multi_lock fails it
+ resets lock type for tables, which were locked before (and
+ including) one that caused error. Lock type for other tables
+ preserved.
+ */
+ reset_lock_data(sql_lock);
thd->some_tables_deleted=1; // Try again
sql_lock->lock_count= 0; // Locks are already freed
// Fall through: unlock, reset lock data, free and retry