Bug #35419 read-only option does not work in 5.0.24a and 5.0.51a
Submitted: 18 Mar 2008 22:21 Modified: 30 Apr 2008 19:51
Reporter: Mark Saad Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:5.0.51a OS:Any
Assigned to: CPU Architecture:Any
Tags: read-only

[18 Mar 2008 22:21] Mark Saad
Description:
In both The Linux 32bit/64bit and FreeBSD 32bit/64bit X86 binary versions of MySQL server v5.0.51a; the read-only option is not enforced by the server . This was working in prior versions of MySQL on both FreeBSD and Linux ( CentOS, Redhat ES, and Ubuntu )

 

How to repeat:
my.cnf
---------
# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
read-only

From the MySQL Shell
----------

mysql> select @@global.read_only\G
*************************** 1. row ***************************
@@global.read_only: 1
1 row in set (0.00 sec)

mysql> create database d;
Query OK, 1 row affected (0.03 sec)

mysql> use d;
Database changed

mysql> CREATE TABLE t (c CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);
Query OK, 0 rows affected (0.03 sec)

mysql> insert into t values ('aa');
Query OK, 1 row affected (0.03 sec)

mysql> select * from t;
+------+
| c    |
+------+
| aa   |
+------+
1 row in set (0.01 sec)

mysql> show variables;
--------output truncated --------
| version                         | 5.0.51a                                                            |
| version_comment                 | MySQL Community Server (GPL)                                       |
| version_compile_machine         | i686                                                               |
| version_compile_os              | pc-linux-gnu                                                       |
| wait_timeout                    | 28800 
+---------------------------------+--------------------------------------------------------------------+
232 rows in set (0.00 sec)

 The same issue is also occurring on the version below.

| version                         | 5.0.51a-log                                                      |
| version_comment                 | MySQL Community Server (GPL)                                     |
| version_compile_machine         | x86_64                                                           |
| version_compile_os              | unknown-freebsd6.0                                               |
| wait_timeout                    | 28800                                                            |
+---------------------------------+------------------------------------------------------------------+
232 rows in set (0.00 sec)
[18 Mar 2008 22:48] Kolbe Kegel
Mark,

Can you please execute SELECT CURRENT_USER(); and SHOW GRANTS; after executing the  CREATE TABLE statement in your test case?
[27 Mar 2008 21:28] Mark Saad
The user has select,insert,update,delete on the global level. I guess you can ignore this then. However it would be nice to have a warning printed when you log in to a read-only slave.
[31 Mar 2008 19:51] Sveta Smirnova
Thank you for the feedback.

Does user have SUPER privilege?
[1 May 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".