Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXCHANGE PARTITION issue: report error between list partition and non-empty table #47154

Closed
snowballbear opened this issue Sep 21, 2023 · 4 comments
Assignees
Labels
affects-6.5 found/gs found by gs may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-7.1 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@snowballbear
Copy link

snowballbear commented Sep 21, 2023

Bug Report

An error is reported when exchanging partitions between the list partition table and a non-empty table, and it is incompatible with MySQL behavior

1. Minimal reproduce step (Required)

List partition table:

CREATE TABLE t1(
`DATE_ID` VARCHAR(10) NOT NULL,
PRIMARY KEY (`DATE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY LIST COLUMNS(`DATE_ID`)
(
PARTITION `P20211231` VALUES IN ("2021-12-31"),
PARTITION `P20220100` VALUES IN ("2022-01-00"),
PARTITION `P20220131` VALUES IN ("2022-01-31")
);
 
CREATE TABLE t2(
`DATE_ID` VARCHAR(10) NOT NULL,
PRIMARY KEY (`DATE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
 
INSERT INTO t2 (`DATE_ID`) VALUES ('2022-01-31');
 
-- EXCHANGE PARTITION:
ALTER TABLE t1 EXCHANGE PARTITION P20220131 WITH TABLE t2;

2. What did you expect to see? (Required)

Partition exchange successful

3. What did you see instead (Required)

TiDB:
mysql> ALTER TABLE t1 EXCHANGE PARTITION P20220131 WITH TABLE t2;
ERROR 1737 (HY000): Found a row that does not match the partition

MySQL:
image

4. What is your TiDB version? (Required)

v6.5.1

@snowballbear snowballbear added the type/bug The issue is confirmed as a bug. label Sep 21, 2023
@snowballbear
Copy link
Author

/found gs

@ti-chi-bot ti-chi-bot bot added the found/gs found by gs label Sep 21, 2023
@jebter
Copy link

jebter commented Sep 21, 2023

/sig sql-infra
/severity major

@ti-chi-bot ti-chi-bot bot added sig/sql-infra SIG: SQL Infra severity/major may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 21, 2023
@jebter
Copy link

jebter commented Sep 21, 2023

/label affects-6.5

@YangKeao YangKeao assigned YangKeao and mjonss and unassigned YangKeao Sep 22, 2023
@mjonss
Copy link
Contributor

mjonss commented Sep 24, 2023

This was fixed by #46533

@mjonss mjonss closed this as completed Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 found/gs found by gs may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-7.1 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants