mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
This commit is contained in:
13
mysql-test/r/rpl_commit_after_flush.result
Normal file
13
mysql-test/r/rpl_commit_after_flush.result
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
slave stop;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
reset master;
|
||||||
|
reset slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
slave start;
|
||||||
|
create table t1 (a int) type=innodb;
|
||||||
|
begin;
|
||||||
|
insert into t1 values(1);
|
||||||
|
flush tables with read lock;
|
||||||
|
commit;
|
||||||
|
unlock tables;
|
||||||
|
drop table t1;
|
17
mysql-test/t/rpl_commit_after_flush.test
Normal file
17
mysql-test/t/rpl_commit_after_flush.test
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
source include/master-slave.inc;
|
||||||
|
source include/have_innodb.inc;
|
||||||
|
create table t1 (a int) type=innodb;
|
||||||
|
begin;
|
||||||
|
insert into t1 values(1);
|
||||||
|
flush tables with read lock;
|
||||||
|
commit;
|
||||||
|
save_master_pos;
|
||||||
|
connection slave;
|
||||||
|
sync_with_master;
|
||||||
|
# cleanup
|
||||||
|
connection master;
|
||||||
|
unlock tables;
|
||||||
|
drop table t1;
|
||||||
|
save_master_pos;
|
||||||
|
connection slave;
|
||||||
|
sync_with_master;
|
@@ -751,9 +751,15 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, bool is_not_commi
|
|||||||
{
|
{
|
||||||
if (thd->global_read_lock) // This thread had the read locks
|
if (thd->global_read_lock) // This thread had the read locks
|
||||||
{
|
{
|
||||||
|
if (is_not_commit)
|
||||||
my_error(ER_CANT_UPDATE_WITH_READLOCK,MYF(0));
|
my_error(ER_CANT_UPDATE_WITH_READLOCK,MYF(0));
|
||||||
(void) pthread_mutex_unlock(&LOCK_open);
|
(void) pthread_mutex_unlock(&LOCK_open);
|
||||||
DBUG_RETURN(1);
|
/*
|
||||||
|
We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does.
|
||||||
|
This allowance is needed to not break existing versions of innobackup
|
||||||
|
which do a BEGIN; INSERT; FLUSH TABLES WITH READ LOCK; COMMIT.
|
||||||
|
*/
|
||||||
|
DBUG_RETURN(is_not_commit);
|
||||||
}
|
}
|
||||||
old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
|
old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
|
||||||
"Waiting for release of readlock");
|
"Waiting for release of readlock");
|
||||||
|
Reference in New Issue
Block a user