summaryrefslogtreecommitdiff
path: root/mysql-test/r/read_only.result
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2006-11-20 20:40:35 -0700
committerunknown <malff/marcsql@weblab.(none)>2006-11-20 20:40:35 -0700
commit77b7a86206508a074eb6750ba628dfbef3f39e74 (patch)
tree188d3023a83b186369be3c01d8cf8e758b3ad4b6 /mysql-test/r/read_only.result
parent78be2cdcbe1ff173d4086b1339e5f79be5bc2914 (diff)
downloadmariadb-git-77b7a86206508a074eb6750ba628dfbef3f39e74.tar.gz
WL#3602 (SET GLOBAL READONLY)
Bug#11733 (COMMITs should not happen if read-only is set) Bug#22009 (Can write to a read-only server under some circumstances) See the work log for details The change consist of a) acquiring the global read lock in SET GLOBAL READONLY b) honoring opt_readonly in ha_commit_trans(), c) honoring opt_readonly in mysql_lock_tables(). a) takes care of the server stability, b) makes the transactional tables safe (Bug 11733) c) makes the non transactional tables safe (Bug 22009) mysql-test/r/read_only.result: WL#3602 (SET GLOBAL READONLY) mysql-test/t/read_only.test: WL#3602 (SET GLOBAL READONLY) sql/handler.cc: WL#3602 (SET GLOBAL READONLY) sql/lock.cc: WL#3602 (SET GLOBAL READONLY) sql/set_var.cc: WL#3602 (SET GLOBAL READONLY) sql/set_var.h: WL#3602 (SET GLOBAL READONLY) mysql-test/r/read_only_innodb.result: WL#3602 (SET GLOBAL READONLY) mysql-test/t/read_only_innodb.test: WL#3602 (SET GLOBAL READONLY)
Diffstat (limited to 'mysql-test/r/read_only.result')
-rw-r--r--mysql-test/r/read_only.result52
1 files changed, 51 insertions, 1 deletions
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result
index 1a1991a6255..337143ce414 100644
--- a/mysql-test/r/read_only.result
+++ b/mysql-test/r/read_only.result
@@ -39,6 +39,56 @@ delete t1 from t1,t3 where t1.a=t3.a;
drop table t1;
insert into t1 values(1);
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+set global read_only=0;
+lock table t1 write;
+lock table t2 write;
+set global read_only=1;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables ;
+set global read_only=1;
+select @@global.read_only;
+@@global.read_only
+0
+unlock tables ;
+select @@global.read_only;
+@@global.read_only
+1
+set global read_only=0;
+lock table t1 read;
+lock table t2 read;
+set global read_only=1;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables ;
+set global read_only=1;
+select @@global.read_only;
+@@global.read_only
+0
+unlock tables ;
+select @@global.read_only;
+@@global.read_only
+1
+set global read_only=0;
+BEGIN;
+BEGIN;
+set global read_only=1;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+ROLLBACK;
+set global read_only=1;
+select @@global.read_only;
+@@global.read_only
+1
+ROLLBACK;
+set global read_only=0;
+flush tables with read lock;
+set global read_only=1;
+unlock tables;
+set global read_only=0;
+flush tables with read lock;
+set global read_only=1;
+select @@global.read_only;
+@@global.read_only
+1
+unlock tables;
+set global read_only=0;
drop table t1,t2;
drop user test@localhost;
-set global read_only=0;