Skip to content

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

Closed

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 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Activity

  1. lance6716 commented on Feb 5, 2025

    @lance6716
    Contributor

    Currently we didn't write these values as MySQL's definition https://dev.mysql.com/doc/refman/8.4/en/information-schema-partitions-table.html

  2. changed the title [-]truncate one partition ,the 'creat_time' of all partition tables has been updated[/-] [+]truncate one partition ,the 'create_time' of all partition tables has been updated[/+] on Feb 6, 2025
  3. self-assigned this
    on Feb 6, 2025
  4. added a commit that references this issue on Feb 7, 2025
    d51f6f0
  5. added
    affects-6.5This bug affects the 6.5.x(LTS) versions.
    affects-6.1This bug affects the 6.1.x(LTS) versions.
    affects-7.1This bug affects the 7.1.x(LTS) versions.
    affects-8.5This bug affects the 8.5.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.
    on Mar 4, 2025
  6. added a commit that references this issue on May 6, 2025
    a5dc978
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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