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

Engine for temporary tables which are implicitly created as RocksDB is substituted silently

Details

    Description

      From RocksDB tests I can see that temporary tables are currently not supported. It produces a meaningful error message when the engine is provided explicitly:

      MariaDB [test]> create temporary table t1 (i int) engine=RocksDB;
      ERROR 1478 (HY000): Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
      

      But when the engine is implied, either via default_storage_engine, or via CREATE .. LIKE, it is silently substituted by MyISAM – not only does the statement succeed, but it doesn't even produce a warning:

      MariaDB [test]> create table t1 (i int) engine=RocksDB;
      Query OK, 0 rows affected (0.11 sec)
       
      MariaDB [test]> create temporary table t2 like t1;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> show create table t2;
      +-------+-------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                    |
      +-------+-------------------------------------------------------------------------------------------------+
      | t2    | CREATE TEMPORARY TABLE `t2` (
        `i` int(11) DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
      +-------+-------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      

      (on some reason, it's MyISAM, despite default_storage_engine and default_tmp_storage_engine being InnoDB).

      or,

      MariaDB [test]> set default_storage_engine=RocksDB, default_tmp_storage_engine=RocksDB;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> create temporary table t2 (i int);
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> show create table t2;
      +-------+-------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                    |
      +-------+-------------------------------------------------------------------------------------------------+
      | t2    | CREATE TEMPORARY TABLE `t2` (
        `i` int(11) DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
      +-------+-------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      

      I saw the scenario with LIKE in RocksDB tests too, but I'm not sure whether it's actually intended or was just recorded because "temporary tables don't work anyway". It doesn't look right.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            error messages - ER_ILLEGAL_HA is used for all other ha_check_storage_engine_flag flag. I see you've gone with ER_ILLEGAL_HA_CREATE_OPTION. Given you can't alter table to a tempoary table this might be ok. serg's call however.

            On mtr break - start of debugging this provided on Zulip
            e.g

            gdb for the functions you've changed

            mysql-test/mtr --mem --gdb='b my_error;b check_engine;b check_unsupported_engine;r' --boot-gdb rocksdb.create_table
            

            danblack Daniel Black added a comment - error messages - ER_ILLEGAL_HA is used for all other ha_check_storage_engine_flag flag. I see you've gone with ER_ILLEGAL_HA_CREATE_OPTION. Given you can't alter table to a tempoary table this might be ok. serg 's call however. On mtr break - start of debugging this provided on Zulip e.g gdb for the functions you've changed mysql-test/mtr --mem --gdb='b my_error;b check_engine;b check_unsupported_engine;r' --boot-gdb rocksdb.create_table

            Hi serg, can you please review PR 774.
            Thanks.

            anel Anel Husakovic added a comment - Hi serg , can you please review PR 774 . Thanks.

            cvicentiu PR 774 updated for 10.7 please review.

            anel Anel Husakovic added a comment - cvicentiu PR 774 updated for 10.7 please review.

            OK to push.

            cvicentiu Vicențiu Ciorbaru added a comment - OK to push.

            Pushed with commit f7216fa63d in 10.7

            anel Anel Husakovic added a comment - Pushed with commit f7216fa63d in 10.7

            People

              anel Anel Husakovic
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              8 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.