Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
5.5.34
-
CentOS 5.10 x86_64
Description
(also reported to MySQL here: http://bugs.mysql.com/bug.php?id=71136)
The "read_only" global variable is not respected by the DROP TRIGGER command, even for a non-SUPER user. It does appear to respect read_only for CREATE TRIGGER. This should return an error, not succeed.
MariaDB [foo]> select @@version;
|
+--------------------+
|
| @@version |
|
+--------------------+
|
| 5.5.34-MariaDB-log |
|
+--------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [foo]> select @@read_only;
|
+-------------+
|
| @@read_only |
|
+-------------+
|
| 1 |
|
+-------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [foo]> show grants for current_user;
|
+--------------------------------------------------------------------------------+
|
| Grants for foo@localhost |
|
+--------------------------------------------------------------------------------+
|
| GRANT USAGE ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD 'redacted' |
|
| GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER ON `foo`.* TO 'foo'@'localhost' |
|
+--------------------------------------------------------------------------------+
|
2 rows in set (0.00 sec)
|
|
MariaDB [foo]> DROP TRIGGER ins_sum;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [foo]> CREATE TRIGGER ins_sum BEFORE INSERT ON account FOR EACH ROW SET @sum = @sum + NEW.amount;
|
ERROR 1290 (HY000): The MariaDB server is running with the --read-only option so it cannot execute this statement
|