Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.4, 11.8, 12.3, 13.1, 13.2, 13.3
Description
Likely cause: old code in ha_partition::check_misplaced_rows(), not a recent change. MySQL 5.7, 8.0 and 9.1 give the same error. The testcase needs WITHOUT VALIDATION, which MDEV-22164 added in CS 11.4, so it does not run on older versions.
--source include/have_partition.inc
|
--source include/have_innodb.inc
|
call mtr.add_suppression("was altered WITHOUT VALIDATION"); |
CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2)); |
CREATE TABLE t2 (a INT) ENGINE=InnoDB; |
INSERT INTO t2 VALUES (1), (3); |
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2 WITHOUT VALIDATION; |
--let $m= query_get_value(CHECK TABLE t1, Msg_text, 2)
|
--let $bad= `SELECT '$m' LIKE '%internal error%'`
|
if ($bad) |
{
|
--die The row 3 fits no partition, and CHECK TABLE reports it as an internal error: $m |
}
|
DROP TABLE t1, t2; |
Leads to:
|
CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Optimized, Clang 22.1.8-20260622) Build 05/10/2026 |
mysqltest: At line 12: The row 3 fits no partition, and CHECK TABLE reports it as an internal error: Unknown - internal error 160 during operation
|
CHECK TABLE t1 gives Partition p0 returned error and Unknown - internal error 160 during operation, and REPAIR TABLE t1 gives the same. ALTER TABLE t1 REBUILD PARTITION p0 then removes the row 3 without a warning. MDEV-41598 shows the same for REORGANIZE PARTITION. A row that fits another partition is reported as "Found a misplaced row" and is moved by REPAIR TABLE. MyISAM, Aria and debug builds give the same result.
From the code it seems that ha_partition::check_misplaced_rows() stops at the first error of get_partition_id(), which is HA_ERR_NO_PARTITION_FOUND (160) for this row, and returns it as it is.
Attachments
Issue Links
- relates to
-
MDEV-21042 REORGANIZE PARTITION is not working well on LIST COLUMNS partition type
-
- Confirmed
-
-
MDEV-22164 WITHOUT VALIDATION for EXCHANGE PARTITION/CONVERT IN
-
- Closed
-
-
MDEV-33128 WITHOUT VALIDATION allows to insert duplicate values into unique key without a way to repair
-
- Confirmed
-
-
MDEV-41598 REORGANIZE PARTITION on a LIST table deletes the rows whose value is no longer in any partition
-
- Open
-