-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.component/tablepartitionThis issue is related to Table Partition of TiDB.This issue is related to Table Partition of TiDB.severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
drop table if exists t;
CREATE TABLE t (
a int unsigned NOT NULL AUTO_INCREMENT,
b varchar(255) DEFAULT NULL,
PRIMARY KEY (a),
KEY (b)
);
insert into t values (1,1),(2,2),(3,3),(4,4);
-- 1k
insert into t select null, t2.a from t, t t1, t t2, t t3, t t4;
-- 1M
insert into t select null, t2.a from t, t t2;
alter table t partition by key(b) partitions 100;
-- Wait until it shows as running, start a new session
-- check with admin show ddl jobs;
-- then
admin cancel ddl jobs <JOB_ID from above>;
-- Then the table is left in an intermediate state:
show create table t;
2. What did you expect to see? (Required)
Table rollbacked as previous state, non-partitioned
3. What did you see instead (Required)
Table is in an intermediate state, technically partitioned, but only with one partition and partitioned by NONE()
tidb> show create table t\G
*************************** 1. row ***************************
Table: t
Create Table: CREATE TABLE `t` (
`a` int(10) unsigned NOT NULL AUTO_INCREMENT,
`b` varchar(255) DEFAULT NULL,
PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */,
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1730010
PARTITION BY NONE ()
(PARTITION `pFullTable` COMMENT 'Intermediate partition during ALTER TABLE ... PARTITION BY ...')
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
tidb_version(): Release Version: v8.0.0-alpha-235-ga29bbb5ca1
Edition: Community
Git Commit Hash: a29bbb5ca180177b532d05283970ae17fc866ee9
Git Branch: master
UTC Build Time: 2024-02-09 12:49:36
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore
Metadata
Metadata
Assignees
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.component/tablepartitionThis issue is related to Table Partition of TiDB.This issue is related to Table Partition of TiDB.severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.