mariadb/mysql-test/r/flush_block_commit.result
unknown 352ad8156c two-line fix for BUG#6732 "FLUSH TABLES WITH READ LOCK + COMMIT makes next FLUSH...LOCK hang forever"
(originally reported as "second run of innobackup hangs forever and can even hang server").
Plus testcase for the bugfix and comments about global read locks.


mysql-test/r/flush_block_commit.result:
  result update
mysql-test/t/flush_block_commit.test:
  testing bugfix (originally: second run of innobackup hangs)
sql/lock.cc:
  When we are in start_waiting_global_read_lock(), if we ourselves have
  the global read lock, there is nothing to start. This makes a pair with how 
  wait_if_global_read_lock() behaves when we ourselves have the global read lock.
  Previously, start_waiting_global_read_lock() decremented protect... whereas wait_if_global_read_lock()
  hadn't incremented it => very wrong => hangs.
  Descriptive comments on how global read lock works.
2004-11-30 22:20:52 +01:00

31 lines
475 B
Text

drop table if exists t1;
create table t1 (a int) type=innodb;
begin;
insert into t1 values(1);
flush tables with read lock;
select * from t1;
a
commit;
select * from t1;
a
unlock tables;
begin;
select * from t1 for update;
a
1
begin;
select * from t1 for update;
flush tables with read lock;
commit;
a
1
unlock tables;
commit;
begin;
insert into t1 values(10);
flush tables with read lock;
commit;
unlock tables;
flush tables with read lock;
unlock tables;
drop table t1;