Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL)
-
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Linux 2.6.32-431.46.2.el6.x86_64 #1 SMP Mon Dec 15 14:20:02 EST 2014 x86_64 x86_64 x86_64 GNU/Linux
Description
When the server is running in read_only mode, and when connected as a user that does not have the SUPER privilege, it is possible to create a real table if a temporary table with the same name already exists.
MariaDB [test]> CREATE TABLE test1 (id INT);
|
ERROR 1290 (HY000): The MariaDB server is running with the --read-only option so it cannot execute this statement
|
|
MariaDB [test]> CREATE TEMPORARY TABLE test1 (id INT);
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> CREATE TABLE test1 (id INT);
|
Query OK, 0 rows affected (0.01 sec)
|
|
MariaDB [test]> DROP TEMPORARY TABLE test1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> DESCRIBE test1;
|
+-------+---------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+---------+------+-----+---------+-------+
|
| id | int(11) | YES | | NULL | |
|
+-------+---------+------+-----+---------+-------+
|
1 row in set (0.00 sec)
|
As you can see, the real table persists.
Incidentally, this happens both when binary logging is enabled and when it is not.