Below is the list of changes that have just been committed into a local
5.1 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-06-18 22:22:31+05:00, ramil@stripped +3 -0
Sdditional fix-up for bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
FLUSH LOGS should ignore SET GLOBAL READ_ONLY.
sql/lock.cc@stripped, 2007-06-18 22:22:29+05:00, ramil@stripped +6 -5
Sdditional fix-up for bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
- ignore SET GLOBAL READ_ONLY if MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY is set.
sql/mysql_priv.h@stripped, 2007-06-18 22:22:29+05:00, ramil@stripped +1 -0
Sdditional fix-up for bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
- MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY added.
sql/sql_base.cc@stripped, 2007-06-18 22:22:29+05:00, ramil@stripped +3 -2
Sdditional fix-up for bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
- ignore SET GLOBAL READ_ONLY as well if called form a logger.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: ramil
# Host: ramil.myoffice.izhnet.ru
# Root: /home/ram/work/mysql-5.1-maint
--- 1.109/sql/lock.cc 2007-06-18 22:22:35 +05:00
+++ 1.110/sql/lock.cc 2007-06-18 22:22:35 +05:00
@@ -92,6 +92,7 @@ static void print_lock_error(int error,
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,
}
}
- 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.
--- 1.517/sql/mysql_priv.h 2007-06-18 22:22:35 +05:00
+++ 1.518/sql/mysql_priv.h 2007-06-18 22:22:35 +05:00
@@ -1765,6 +1765,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd,
#define MYSQL_LOCK_IGNORE_FLUSH 0x0002
#define MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN 0x0004
#define MYSQL_OPEN_TEMPORARY_ONLY 0x0008
+#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY 0x0010
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
--- 1.409/sql/sql_base.cc 2007-06-18 22:22:35 +05:00
+++ 1.410/sql/sql_base.cc 2007-06-18 22:22:35 +05:00
@@ -4020,9 +4020,10 @@ int lock_tables(THD *thd, TABLE_LIST *ta
TABLE **start,**ptr;
uint lock_flag= MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN;
- /* Don't honor the GLOBAL READ LOCK if called from a logger */
+ /* Ignore GLOBAL READ LOCK and GLOBAL READ_ONLY if called from a logger */
if (logger.is_privileged_thread(thd))
- lock_flag|= MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK;
+ lock_flag|= (MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |
+ MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY);
if (!(ptr=start=(TABLE**) thd->alloc(sizeof(TABLE*)*count)))
DBUG_RETURN(-1);
| Thread |
|---|
| • bk commit into 5.1 tree (ramil:1.2505) BUG#26380 | ramil | 18 Jun |