summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-02 23:47:23 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-02 23:47:23 +0300
commit77cbfd85ee3f6969dcbe528a2f97ec12c9cf99dc (patch)
treece951be1a1212aaa9bd9c5db2ef73257ce2f1f29 /sql/lock.cc
parent124cda8a0a783180b280935fd4b62a2b7d6dc6c4 (diff)
downloadmariadb-git-77cbfd85ee3f6969dcbe528a2f97ec12c9cf99dc.tar.gz
Backport of:
---------------------------------------------------------- revno: 2630.4.35 committer: Konstantin Osipov <konstantin@mysql.com> branch nick: mysql-6.0-3726 timestamp: Wed 2008-06-25 16:44:00 +0400 message: Fix a MyISAM-specific bug in the new implementation of LOCK TABLES (WL#3726). If more than one instance of a MyISAM table are open in the same connection, all of them must share the same status_param. Otherwise, unlock of a table may lead to lost records. See also comments in thr_lock.c. include/thr_lock.h: Declare thr_lock_merge_status(). mysql-test/r/lock.result: Update test results (WL#3726). mysql-test/t/lock.test: Add a test case for the situation when the same table is locked twice by LOCK TABLES, and only one instance is updated. mysys/thr_lock.c: Move the code that makes sure all status_params of the same table are shared into a separate function. sql/lock.cc: Make sure that status_param is shared when a table is reopened.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 199ab354c22..d19f4b46821 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -687,6 +687,8 @@ MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b)
/* Delete old, not needed locks */
my_free((uchar*) a,MYF(0));
my_free((uchar*) b,MYF(0));
+
+ thr_lock_merge_status(sql_lock->locks, sql_lock->lock_count);
DBUG_RETURN(sql_lock);
}