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

Application-time period table can be temporary despite the error ER_PERIOD_TEMPORARY_NOT_ALLOWED

    XMLWordPrintable

Details

    Description

      A plain attempt to create a temporary table with app-time period fails:

      MariaDB [test]> create temporary table tmp (a int, s date, e date, period for app(s,e));
      ERROR 4152 (HY000): Application-time period table cannot be temporary
      

      However, creating the same table via CREATE .. LIKE is possible:

      10.4 89ae01fd0085cf0d1af272eca545e49fdadf4538

      MariaDB [test]> create table t1 (a int, s date, e date, period for app(s,e));
      Query OK, 0 rows affected (0.226 sec)
       
      MariaDB [test]> create temporary table tmp like t1;
      Query OK, 0 rows affected (0.048 sec)
      

      Which of course ends up with the structure which cannot be re-created:

      MariaDB [test]> show create table tmp;
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                                              |
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | tmp   | CREATE TEMPORARY TABLE `tmp` (
        `a` int(11) DEFAULT NULL,
        `s` date NOT NULL,
        `e` date NOT NULL,
        PERIOD FOR `app` (`s`, `e`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

      It should be consistent, either one way or another.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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