summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorramil/ram@mysql.com/ramil.myoffice.izhnet.ru <>2007-06-18 22:22:31 +0500
committerramil/ram@mysql.com/ramil.myoffice.izhnet.ru <>2007-06-18 22:22:31 +0500
commit5b22bc3bd59dcc75828072ce738c8acb3ab254fc (patch)
tree74a69765d58239d1fa8e65d778a54bb84e05b014 /sql/lock.cc
parent6ab97748feb2e19e4bf5b362bc9c5c5fe0db8eb1 (diff)
downloadmariadb-git-5b22bc3bd59dcc75828072ce738c8acb3ab254fc.tar.gz
Sdditional fix-up for bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
FLUSH LOGS should ignore SET GLOBAL READ_ONLY.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 9785bc4ac00..9c5b5b9d88a 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -92,6 +92,7 @@ static void print_lock_error(int error, const char *);
count The number of tables to lock.
flags Options:
MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK Ignore a global read lock
+ MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY Ignore SET GLOBAL READ_ONLY
MYSQL_LOCK_IGNORE_FLUSH Ignore a flush tables.
MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN Instead of reopening altered
or dropped tables by itself,
@@ -150,11 +151,11 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
}
}
- if ( write_lock_used
- && opt_readonly
- && ! (thd->security_ctx->master_access & SUPER_ACL)
- && ! thd->slave_thread
- )
+ if (!(flags & MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY) &&
+ write_lock_used &&
+ opt_readonly &&
+ !(thd->security_ctx->master_access & SUPER_ACL) &&
+ !thd->slave_thread)
{
/*
Someone has issued SET GLOBAL READ_ONLY=1 and we want a write lock.