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

CREATE TABLE .. LIKE syntax extensions: engine change, add system versioning

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      F.ex. counters collection task:

      create table stats like information_schema.innodb_metrics;
      alter table stats add system versioning;
       
      # periodically:
      delete from stats;
      insert stats select * from information_schema.innodb_metrics where status = 'enabled';
      

      The above creates table `stats` with ENGINE=MEMORY. It would be useful to have `stats` persistent. CREATE TABLE .. LIKE cannot:

      • change ENGINE of the table;
      • add SYSTEM VERSIONING.

      So ideally the below should work:

      create table stats engine=aria like information_schema.innodb_metrics with system versioning;
      

      Note that CREATE .. SELECT can change the engine:

      create or replace table stats2 engine=aria as select * from information_schema.innodb_metrics;
      

      It would be nice and user-friendly if CREATE .. LIKE could do that as well.

      Attachments

        Activity

          People

            Unassigned Unassigned
            midenok Aleksey Midenkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.