[MDEV-29770] Broken table cannot be CREATE OR REPLACE -ed anymore Created: 2022-10-11  Updated: 2023-05-18  Resolved: 2023-01-26

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-25292 Atomic CREATE OR REPLACE TABLE Stalled
Relates

 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



 Comments   
Comment by Aleksey Midenkov [ 2022-10-17 ]

Please review bb-10.11-midenok

Generated at Thu Feb 08 10:11:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.