summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authormalff/marcsql@weblab.(none) <>2007-01-02 14:18:13 -0700
committermalff/marcsql@weblab.(none) <>2007-01-02 14:18:13 -0700
commit0055056c91426b11be40a70902230ef5d0dcdcdd (patch)
tree1a43bc5c6b21902a943e0a8759f9f36c9c407c1c /sql/handler.cc
parent60a3f102a475fc38dc0efcd1519b3385a39fb752 (diff)
parentc55862698ebc7aafdfeeba47170c9f7b89b66eec (diff)
downloadmariadb-git-0055056c91426b11be40a70902230ef5d0dcdcdd.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-merge
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index e0955132998..3d47a6a2eaf 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -691,6 +691,19 @@ int ha_commit_trans(THD *thd, bool all)
ha_rollback_trans(thd, all);
DBUG_RETURN(1);
}
+
+ 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);
+ error= 1;
+ goto end;
+ }
+
DBUG_EXECUTE_IF("crash_commit_before", abort(););
/* Close all cursors that can not survive COMMIT */