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

Broken table cannot be CREATE OR REPLACE -ed anymore

    XMLWordPrintable

Details

    Description

      When CREATE OR REPLACE was working as DROP + CREATE, even a hopelessly damaged table could be CREATE OR REPLACE -ed, because it could be dropped (with a warning). It is no longer the case, now CREATE OR REPLACE fails on such tables, and an explicit DROP is required instead.

      Maybe it's an unavoidable limitation or even an intentional change, but taking into account usual preferences of the reviewer, it has to be clarified.

      create table t (b int) engine=MyISAM;
      --let $datadir= `select @@datadir`
      --remove_file $datadir/test/t.MYI
       
      create or replace table t (a int);
      show create table t;
       
      # Cleanup
      drop table if exists t;
      

      After MDEV-25292:

      bb-10.11-midenok 8e82c973eeb

      create or replace table t (a int);
      bug.t2                                   [ fail ]
              Test ended at 2022-10-11 23:42:20
       
      CURRENT_TEST: bug.t2
      mysqltest: At line 5: query 'create or replace table t (a int)' failed: ER_FILE_NOT_FOUND (1017): Can't find file: './test/t.MYI' (errno: 2 "No such file or directory")
      

      Before MDEV-25292:

      10.10 bb76dcbe

      create or replace table t (a int);
      Warnings:
      Error	6	Error on delete of './test/t.MYI' (Errcode: 2 "No such file or directory")
      show create table t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
      

      Attachments

        Issue Links

          Activity

            People

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