diff options
author | unknown <malff/marcsql@weblab.(none)> | 2006-11-30 18:43:33 -0700 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2006-11-30 18:43:33 -0700 |
commit | d469888a951368a764f807839c330feec21489f4 (patch) | |
tree | f94df2ec9dc5a369f48c4d034816f41985477e9f /sql/lock.cc | |
parent | de613e2eb2174e9234765dc636ada4ecc1fea406 (diff) | |
download | mariadb-git-d469888a951368a764f807839c330feec21489f4.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.
sql/handler.cc:
Post review changes
Allowing writes for the slave thread or for SUPER, in read-only mode
sql/lock.cc:
Post review changes
Allowing writes for the slave thread or for SUPER, in read-only mode
mysql-test/r/rpl_read_only.result:
New test
mysql-test/t/rpl_read_only-slave.opt:
New test
mysql-test/t/rpl_read_only.test:
New test
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 6 |
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. |