summaryrefslogtreecommitdiff
path: root/mysql-test/r/read_only.result
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2012-08-25 20:57:17 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2012-08-25 20:57:17 +0500
commitd99b8004e6b46e2a1b321bf50825254bf841cddb (patch)
tree0d890d92947dc3c08d0ca9d173c26a3eb27768ce /mysql-test/r/read_only.result
parentf277f27ae2fb4ab45a014027f08093a28acc1c14 (diff)
downloadmariadb-git-d99b8004e6b46e2a1b321bf50825254bf841cddb.tar.gz
SQL syntax extended with START TRANSACTION READ ONLY|READ WRITE
and SET TRANSACTION READ ONLT|READ WRITE statements. per-file comments: mysql-test/include/check-warnings.test READ ONLY transaction flag cleaned. mysql-test/r/commit.result result updated mysql-test/r/read_only.result result updated mysql-test/t/commit.test tests added. mysql-test/t/read_only.test tests added sql/lex.h ONLY symbol added. sql/sql_base.cc DBUG_RETURN added. sql/sql_parse.cc implementations added. sql/sql_yacc.yy SQL syntax extended. storage/perfschema/gen_pfs_lex_token changes forced by lex.h storage/perfschema/pfs_lex_token.h changes forced by lex.h
Diffstat (limited to 'mysql-test/r/read_only.result')
-rw-r--r--mysql-test/r/read_only.result37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result
index 1ffe2b86f70..3811c6c5487 100644
--- a/mysql-test/r/read_only.result
+++ b/mysql-test/r/read_only.result
@@ -157,3 +157,40 @@ delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges;
drop database mysqltest_db1;
set global read_only= @start_read_only;
+#
+# WL#5968 Implement START TRANSACTION READ (WRITE|ONLY);
+#
+#
+# Test interaction with read_only system variable.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE USER user1;
+SET GLOBAL read_only= 1;
+# All allowed with super privilege
+START TRANSACTION;
+COMMIT;
+START TRANSACTION READ ONLY;
+COMMIT;
+START TRANSACTION READ WRITE;
+COMMIT;
+# We allow implicit RW transaction without super privilege
+# for compatibility reasons
+START TRANSACTION;
+# Check that table updates are still disallowed.
+INSERT INTO t1 VALUES (3);
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+UPDATE t1 SET a= 1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+DELETE FROM t1;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+COMMIT;
+START TRANSACTION READ ONLY;
+COMMIT;
+# Explicit RW trans is not allowed without super privilege
+START TRANSACTION READ WRITE;
+ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+COMMIT;
+DROP USER user1;
+SET GLOBAL read_only= 0;
+DROP TABLE t1;