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

Wrong error message upon CREATE OR REPLACE .. LIKE with merge table

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT) ENGINE=MyISAM;
      CREATE TABLE tm (a INT) ENGINE=MERGE UNION(t);
      CREATE OR REPLACE TABLE t LIKE tm;
       
      # Cleanup
      DROP TABLE IF EXISTS tm, t;
      

      10.3 602124bb

      query 'CREATE OR REPLACE TABLE t LIKE tm' failed: 1093: Table 'tm' is specified twice, both as a target for 'CREATE' and as a separate source for data
      

      I'm not sure it should fail at all, since it's LIKE, not CREATE .. SELECT; but even if it should, still the message is wrong – tm is not a target for CREATE, and it is not a source for data since there is no data involved (and a merge table doesn't contain any anyway). It would make more sense if the message was referring t table, at least it is indeed a target for CREATE, and with some stretch it could be claimed that t as an underlying table is a part of tm definition and thus a source for "data".

      Note that before MDEV-29697 fix the above fails on a debug build with an assertion failure.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.