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

CREATE OR REPLACE TABLE is less robust than DROP TABLE + CREATE TABLE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.5
    • None
    • None

    Description

      Starting from 10.5, DROP TABLE works even if a .frm file is missing. But CREATE OR REPLACE TABLE doesn't:

      MariaDB [test]> CREATE TABLE x (a int);
      Query OK, 0 rows affected (0.009 sec)
       
      MariaDB [test]> \! ls -1 /var/lib/mysql/test/x.*
      /var/lib/mysql/test/x.frm
      /var/lib/mysql/test/x.ibd
      MariaDB [test]> \! rm /var/lib/mysql/test/x.frm
      MariaDB [test]> CREATE OR REPLACE TABLE x (a int);
      ERROR 1813 (HY000): Tablespace for table '`test`.`x`' exists. Please DISCARD the tablespace before IMPORT
      MariaDB [test]> DROP TABLE x;
      Query OK, 0 rows affected (0.006 sec)
      

      If this is not a bug, please consider it as a feature request.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              f_razzoli Federico Razzoli
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.