diff options
author | unknown <tsmith@maint1.mysql.com> | 2007-06-18 22:13:23 +0200 |
---|---|---|
committer | unknown <tsmith@maint1.mysql.com> | 2007-06-18 22:13:23 +0200 |
commit | 40f6e9a6ae2d775d221ab0080b795da6f18ccfe8 (patch) | |
tree | 1c4ebd2094671e332031243e1a40330fa7fd5e77 /sql/lock.cc | |
parent | 1140898b32f91ccee38585ccb3b026455c41943c (diff) | |
parent | b2f86cd570e3d155b598d1c2f6527505c9d80dad (diff) | |
download | mariadb-git-40f6e9a6ae2d775d221ab0080b795da6f18ccfe8.tar.gz |
Merge maint1.mysql.com:/data/localhome/tsmith/bk/51
into maint1.mysql.com:/data/localhome/tsmith/bk/maint/51
sql/lock.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 08c109a17ab..50922a682a2 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. @@ -714,9 +715,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, if (!table_ptr[i]-> file-> check_if_locking_is_allowed(thd->lex->sql_command, thd->lex->type, table_ptr[i], count, i, &system_count, - (thd == logger.get_general_log_thd()) || - (thd == logger.get_slow_log_thd()) || - (thd == logger.get_privileged_thread()))) + logger.is_privileged_thread(thd))) DBUG_RETURN(0); } |