Skip to content

truncate one partition ,the 'create_time' of all partition tables has been updated #59238

@knull-cn

Description

@knull-cn

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create partition table

CREATE TABLE t ( a INT, b INT, INDEX idx(b)) 
    PARTITION BY RANGE( a ) (
    PARTITION p1 VALUES LESS THAN (10000),
    PARTITION p2 VALUES LESS THAN (20000),
    PARTITION p3 VALUES LESS THAN (MAXVALUE) ) ;

check the create_time

select table_name,partition_name,tidb_partition_id,create_time from information_schema.partitions where table_name = 't';

truncate one partition p1

alter table t truncate partition p1;

check the create_time ,

select table_name,partition_name,tidb_partition_id,create_time from information_schema.partitions where table_name = 't';

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

'create_time' of partition p1 was updated, and create_time of other partitions was not updated.

3. What did you see instead (Required)

The 'creat_time' of all partition tables has been updated
Image

4. What is your TiDB version? (Required)

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.5.3
Edition: Community
Git Commit Hash: 70bfd90
Git Branch: HEAD
UTC Build Time: 2024-07-31 13:17:12
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Metadata

Metadata

Assignees

Labels

affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.severity/minorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions