diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-02 23:47:23 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-02 23:47:23 +0300 |
commit | 77cbfd85ee3f6969dcbe528a2f97ec12c9cf99dc (patch) | |
tree | ce951be1a1212aaa9bd9c5db2ef73257ce2f1f29 /mysql-test/r/lock.result | |
parent | 124cda8a0a783180b280935fd4b62a2b7d6dc6c4 (diff) | |
download | mariadb-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 'mysql-test/r/lock.result')
-rw-r--r-- | mysql-test/r/lock.result | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 676a8c41bb6..092c376b34a 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -244,5 +244,23 @@ a unlock tables; drop table t1, t2; # +# Ensure that mi_copy_status is called for two instances +# of the same table when it is reopened after a flush. +# +drop table if exists t1; +drop view if exists v1; +create table t1 (c1 int); +create view v1 as select * from t1; +lock tables t1 write, v1 write; +flush table t1; +insert into t1 values (33); +flush table t1; +select * from t1; +c1 +33 +unlock tables; +drop table t1; +drop view v1; +# # End of 6.0 tests. # |