Skip to content

Insert useless key range when add index finished #55014

@Defined2014

Description

@Defined2014

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set tidb_enable_global_index = true;
create table t(a int, b int) partition by hash(b) partitions 64;
alter table t add unique index idx(a);
select count(*) from mysql.gc_delete_range_done group by job_id order by job_id desc limit 1;

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

mysql> select count(*) from mysql.gc_delete_range_done group by job_id order by job_id desc limit 1;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.03 sec)

3. What did you see instead (Required)

mysql> select count(*) from mysql.gc_delete_range_done group by job_id order by job_id desc limit 1;
+----------+
| count(*) |
+----------+
|       64 |
+----------+
1 row in set (0.03 sec)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.2.0-alpha-320-g5c0d73719b-dirty
Edition: Community
Git Commit Hash: 5c0d73719b10f98ad198afb90e7a1f21e3ff4c24
Git Branch: master
UTC Build Time: 2024-06-25 10:37:01
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions