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

CREATE TABLE succeeds w/ read_only mode enabled.

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            meddy Michael Eddy
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.