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

        1. image-2022-09-30-14-37-18-339.png
          80 kB
          kurt.ding
        2. screenshot-1.png
          58 kB
          kurt.ding
        3. screenshot-2.png
          57 kB
          kurt.ding

        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.