| 1 |
SET @saved_value_super= @@GLOBAL.SUPER_READ_ONLY; |
| 2 |
SET @saved_value= @@GLOBAL.read_only; |
| 3 |
CREATE TABLE t1 (a INT); |
| 4 |
INSERT INTO t1 VALUES (1); |
| 5 |
include/save_binlog_position.inc |
| 6 |
BEGIN; |
| 7 |
UPDATE t1 SET a = 1; |
| 8 |
SET GLOBAL SUPER_READ_ONLY=1; |
| 9 |
COMMIT; |
| 10 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 11 |
include/assert.inc [Binlog position did not advance] |
| 12 |
check RO transaction still commits |
| 13 |
BEGIN; |
| 14 |
SELECT * FROM t1; |
| 15 |
a |
| 16 |
1 |
| 17 |
COMMIT; |
| 18 |
check RO txs still can use implicit temporary tables |
| 19 |
BEGIN; |
| 20 |
SELECT * FROM t1 UNION SELECT * FROM t1; |
| 21 |
a |
| 22 |
1 |
| 23 |
COMMIT; |
| 24 |
SET GLOBAL SUPER_READ_ONLY=0; |
| 25 |
CREATE TEMPORARY TABLE t2 (a INT ) ENGINE=INNODB; |
| 26 |
include/save_binlog_position.inc |
| 27 |
BEGIN; |
| 28 |
UPDATE t1 SET a = 1; |
| 29 |
INSERT INTO t2 values(10); |
| 30 |
SET GLOBAL SUPER_READ_ONLY=1; |
| 31 |
COMMIT; |
| 32 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 33 |
include/assert.inc [Binlog position did not advance] |
| 34 |
DROP TABLE t2; |
| 35 |
SET GLOBAL SUPER_READ_ONLY=0; |
| 36 |
SET GLOBAL READ_ONLY=0; |
| 37 |
CREATE USER test@localhost; |
| 38 |
GRANT CREATE TEMPORARY TABLES, UPDATE, DROP ON *.* TO test@localhost; |
| 39 |
include/save_binlog_position.inc |
| 40 |
BEGIN; |
| 41 |
UPDATE t1 SET a = 1; |
| 42 |
SET GLOBAL READ_ONLY=1; |
| 43 |
COMMIT; |
| 44 |
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement |
| 45 |
include/assert.inc [Binlog position did not advance] |
| 46 |
SET GLOBAL READ_ONLY=0; |
| 47 |
CREATE TEMPORARY TABLE t2 (a INT) ENGINE=INNODB; |
| 48 |
include/save_binlog_position.inc |
| 49 |
BEGIN; |
| 50 |
UPDATE t1 SET a = 1; |
| 51 |
INSERT INTO t2 values(10); |
| 52 |
SET GLOBAL READ_ONLY=1; |
| 53 |
COMMIT; |
| 54 |
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement |
| 55 |
include/assert.inc [Binlog position did not advance] |
| 56 |
DROP TABLE t2; |
| 57 |
DROP USER test@localhost; |
| 58 |
SET GLOBAL SUPER_READ_ONLY= @saved_value_super; |
| 59 |
SET GLOBAL read_only= @saved_value; |
| 60 |
DROP TABLE t1; |