[MDEV-29759] Wrong error message upon CREATE OR REPLACE .. LIKE with merge table Created: 2022-10-10  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - MyISAM
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 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.


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