Bug #71132 Temporary table issue in MySQL slave server with read only enabled.
Submitted: 12 Dec 2013 8:58 Modified: 26 Jun 2014 0:29
Reporter: Magesh Kumar R Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.24 OS:Linux (Centos 5)
Assigned to: CPU Architecture:Any

[12 Dec 2013 8:58] Magesh Kumar R
Description:
I am using MySQL 5.5.24, it is a slave server with read only enabled.
I am using user with the following privileges.
select, insert, update, delete, create temporary tables, create, drop, alter
I am able to create temporary table but not able to insert data either with normal insert statement or create temporary table tablename select * tom table.

mysql> create temporary table test1 (id int(5), name varchar(10 ));
Query OK, 0 rows affected (0.06 sec)

mysql> insert into test1 select * from t1;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

where as i was able to insert data into temporary table using load data local infile command:

mysql> load data local infile '/home/mysql/text' into table test1 fields terminated by ',' lines terminated by '\n';
Query OK, 4 rows affected (0.00 sec)
Records: 4  Deleted: 0  Skipped: 0  Warnings: 0

How come we are not able insert data with normal insert but with load data command we are able to insert.

i am not able to create base table, i can understand it cannot be done.
But in one of the bug i saw the below information posted:

According to http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_read_only: "When it is enabled, the server permits no updates except from users that have the SUPER privilege or (on a slave server) from updates performed by slave threads. " This definition says nothing about DDL statements.

Even DDL command doesn't work with read only enabled for non super user.

mysql> create table t2 (id int(2));
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

Does create temporary table doesn't classify into DDL as similar to the create table statement.

How to repeat:
mysql> create temporary table test1 (id int(5), name varchar(10 ));
Query OK, 0 rows affected (0.06 sec)

mysql> insert into test1 select * from t1;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

where as i was able to insert data into temporary table using load data local infile command:

mysql> load data local infile '/home/mysql/text' into table test1 fields terminated by ',' lines terminated by '\n';
Query OK, 4 rows affected (0.00 sec)
Records: 4  Deleted: 0  Skipped: 0  Warnings: 0

How come we are not able insert data with normal insert but with load data command we are able to insert.
[12 Dec 2013 11:56] MySQL Verification Team
Please check for duplicate with http://bugs.mysql.com/bug.php?id=62008 . Thanks.
[13 Jan 2014 1: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".