summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authormalff/marcsql@weblab.(none) <>2006-11-30 18:43:33 -0700
committermalff/marcsql@weblab.(none) <>2006-11-30 18:43:33 -0700
commite1bdc140d163efd6c5e70f9b963a100ccfab65f5 (patch)
treef94df2ec9dc5a369f48c4d034816f41985477e9f /sql/lock.cc
parentbafbe2c7c7efe6daa03e836744a64820d07d0b99 (diff)
downloadmariadb-git-e1bdc140d163efd6c5e70f9b963a100ccfab65f5.tar.gz
WL#3602
Post review changes the --read-only option is not enforced for the slave thread in replication, or for the SUPER user.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 9886149ba77..be267f8d160 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -151,7 +151,11 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
}
}
- if (write_lock_used && opt_readonly)
+ if ( 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.