-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
component/statisticsseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/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)
- Create a table:
create table pt(a int, b varchar(10), index idx_b (b)) partition by range(a) (partition p0 values less than (10), partition p1 values less than (20), partition p2 values less than (30));
- Insert some data:
insert into pt values (1, "a"), (11, "b"), (21, "c");
- Check the meta:
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 445359109485625359 | 103 | 1 | 1 | 0 |
| 445359109485625364 | 104 | 1 | 1 | 0 |
| 445359109485625349 | 105 | 1 | 1 | 0 |
| 445359109485625364 | 102 | 3 | 3 | 0 |
+--------------------+----------+--------------+-------+----------+
4 rows in set (0.00 sec)
- Reorg partition p0 and p1. Merge p0 and p1 into pw:
alter table pt reorganize partition p0, p1 into (partition pw values less than (20));
- Check the meta again:
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 445359109485625359 | 103 | 1 | 1 | 0 |
| 445359109485625364 | 104 | 1 | 1 | 0 |
| 445359109485625349 | 105 | 1 | 1 | 0 |
| 445359109485625364 | 102 | 3 | 3 | 0 |
| 445359172675436552 | 107 | 0 | 0 | 0 |
+--------------------+----------+--------------+-------+----------+
5 rows in set (0.00 sec)
2. What did you expect to see? (Required)
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
-| 445359109485625359 | 103 | 1 | 1 | 0 |
-| 445359109485625364 | 104 | 1 | 1 | 0 |
| 445359109485625349 | 105 | 1 | 1 | 0 |
| 445359109485625364 | 102 | 3 | 3 | 0 |
+| 445359172675436552 | 107 | 2 | 2 | 0 |
+--------------------+----------+--------------+-------+----------+
5 rows in set (0.00 sec)
3. What did you see instead (Required)
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 445359109485625359 | 103 | 1 | 1 | 0 |
| 445359109485625364 | 104 | 1 | 1 | 0 |
| 445359109485625349 | 105 | 1 | 1 | 0 |
| 445359109485625364 | 102 | 3 | 3 | 0 |
| 445359172675436552 | 107 | 0 | 0 | 0 |
+--------------------+----------+--------------+-------+----------+
5 rows in set (0.00 sec)
4. What is your TiDB version? (Required)
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.6.0-alpha-69-gbf8c728934
Edition: Community
Git Commit Hash: bf8c728934c7376765ddd943fd302fcb65af4bf0
Git Branch: master
UTC Build Time: 2023-11-01 08:29:41
GoVersion: go1.21.1
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Metadata
Metadata
Assignees
Labels
component/statisticsseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.