Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5437

DROP TRIGGER command not respecting read_only = 1 setting

    XMLWordPrintable

Details

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            jnicol Jonathan Nicol
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.