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

Read only server throws error when running a create temporary table as select statement

    XMLWordPrintable

Details

    Description

      Read only MariaDB server throws error when running a create temporary table as select statement. The error

      ERROR 1290 (HY000): The MariaDB server is running with the --read-only option so it cannot execute this statement
      

      is thrown. In version 10.5.24 the temporary table gets created but it is not populated any data. In version 10.6.17 and version 11.3.2 the temporary table gets created and is populated with data.
      As far as I understand, this statement should be allowed on a read-only server, can we find a way to no longer throw this error.

      Steps to reproduce

      -- Log in as a super user
      set global read_only=ON;
      use test;
      create table test_tbl(a int);
      create user test_user@localhost identified by 'NotSecure';
      grant insert, select, update, delete, create temporary tables on test.* to test_user@localhost;
      insert into test_tbl select * from seq_1_to_5;
      -- Log in as the limited privledge user mariadb -u test_user -pNotSecure test
      create temporary table tmp_test_tbl as select * from test_tbl;  -- error will be thrown here
      select * from tmp_test_tbl; -- 10.6 & higher return results 10.5 has an empty table
      create temporary table tmp_test_tbl2 like test_tbl;   -- This succeeds with no error
      insert into tmp_test_tbl2 select * from test_tbl -- This succeeds with no error
      select * from tmp_test_tbl2; -- This returns data 
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            kyle.hutchinson Kyle Hutchinson
            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.