summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
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 */