read_only mode prevents non-SELECT EXPLAIN statements
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Setting super_read_only prevents EXPLAIN DELETE, INSERT, REPLACE, or UPDATE statements from executing.
mysql> SET GLOBAL super_read_only=1;
mysql> EXPLAIN DELETE FROM users WHERE id=1\G
ERROR 1290 (HY000): The MySQL server is running with the --read-only (super) option so it cannot execute this statement
mysql> EXPLAIN INSERT INTO users SET id=1\G
ERROR 1290 (HY000): The MySQL server is running with the --read-only (super) option so it cannot execute this statement
mysql> EXPLAIN REPLACE INTO users SET id=1\G
ERROR 1290 (HY000): The MySQL server is running with the --read-only (super) option so it cannot execute this statement
mysql> EXPLAIN UPDATE users SET id=2 WHERE id=1\G
ERROR 1290 (HY000): The MySQL server is running with the --read-only (super) option so it cannot execute this statement
Server version: 5.6.25-73.1-log Percona Server (GPL), Release 73.1, Revision 07b797f
It is not "super_read_only" specific, it happens also for normal read_only:
mysql [localhost] {msandbox_ro} (test) > select @@version, @@version_ comment, @@read_ only; -----+- ------- ------- ------- ------- -+----- ------- -+ -----+- ------- ------- ------- ------- -+----- ------- -+ -----+- ------- ------- ------- ------- -+----- ------- -+
+------
| @@version | @@version_comment | @@read_only |
+------
| 5.6.26 | MySQL Community Server (GPL) | 1 |
+------
1 row in set (0.00 sec)
mysql [localhost] {msandbox_ro} (test) > explain delete from foo;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement
slave1 [localhost] {msandbox_ro} (test) > select @@version, @@version_ comment; -----+- ------- ------- ------- ------- -+ -----+- ------- ------- ------- ------- -+ -----+- ------- ------- ------- ------- -+
+------
| @@version | @@version_comment |
+------
| 5.7.9-log | MySQL Community Server (GPL) |
+------
1 row in set (0.01 sec)
slave1 [localhost] {msandbox_ro} (test) > show variables like '%read_only'; ------- -----+- ------+ ------- -----+- ------+ ------- -----+- ------+
+------
| Variable_name | Value |
+------
| innodb_read_only | OFF |
| read_only | ON |
| super_read_only | OFF |
| tx_read_only | OFF |
+------
4 rows in set (0.00 sec)
slave1 [localhost] {msandbox_ro} (test) > explain update foo set bar=1;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement