1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Making FLUSH TABLES WITH READ LOCK block COMMITs of existing transactions,

in a deadlock-free manner. This splits locking the global read lock in two steps.
This fixes a consequence of this bug, known as:
BUG#4953 'mysqldump --master-data may report incorrect binlog position if using InnoDB'
And a test.
This commit is contained in:
guilhem@mysql.com
2004-08-20 16:35:23 +02:00
parent 96a000ae78
commit 5db56a106b
9 changed files with 154 additions and 21 deletions

View File

@ -42,7 +42,7 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not create database if another thread is holding read lock
if (wait_if_global_read_lock(thd,0))
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
goto exit2;
@ -146,7 +146,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
VOID(pthread_mutex_lock(&LOCK_mysql_create_db));
// do not drop database if another thread is holding read lock
if (wait_if_global_read_lock(thd,0))
if (wait_if_global_read_lock(thd, 0, 1))
{
error= -1;
goto exit2;