[MDEV-28599] EXCHANGE PARTITION on view causes ER_CHECK_NO_SUCH_TABLE instead of ER_WRONG_OBJECT Created: 2022-05-17  Updated: 2022-05-30  Resolved: 2022-05-30

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Views
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Nayuta Yanagisawa (Inactive)
Resolution: Fixed Votes: 0
Labels: upstream


 Description   

--source include/have_partition.inc
 
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
CREATE TABLE t2 (a INT);
CREATE VIEW v AS SELECT * FROM t1;
ALTER TABLE v EXCHANGE PARTITION p0 WITH TABLE t2;
 
# Cleanup
DROP VIEW v;
DROP TABLE t1, t2;

10.3 3e564d46

mysqltest: At line 6: query 'ALTER TABLE v EXCHANGE PARTITION p0 WITH TABLE t2' failed: 1177: Can't open table

An error is of course expected, but in other similar situations it would be

mysqltest: At line 6: query 'ALTER TABLE v PARTITION BY HASH(a)' failed: 1347: 'test.v' is not of type 'BASE TABLE'

ER_CHECK_NO_SUCH_TABLE "Can't open table" is misleading as it hints at table corruption.

Also reproducible on MySQL 5.7, 8.0.



 Comments   
Comment by Nayuta Yanagisawa (Inactive) [ 2022-05-29 ]

https://github.com/MariaDB/server/pull/2139

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