summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2006-11-30 18:43:33 -0700
committerunknown <malff/marcsql@weblab.(none)>2006-11-30 18:43:33 -0700
commitd469888a951368a764f807839c330feec21489f4 (patch)
treef94df2ec9dc5a369f48c4d034816f41985477e9f /sql/handler.cc
parentde613e2eb2174e9234765dc636ada4ecc1fea406 (diff)
downloadmariadb-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/handler.cc')
-rw-r--r--sql/handler.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index e97fb7ddee4..2ba0be11ec4 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -693,7 +693,11 @@ int ha_commit_trans(THD *thd, bool all)
DBUG_RETURN(1);
}
- if (is_real_trans && opt_readonly)
+ if ( is_real_trans
+ && opt_readonly
+ && ! (thd->security_ctx->master_access & SUPER_ACL)
+ && ! thd->slave_thread
+ )
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
ha_rollback_trans(thd, all);