Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change partition key attribute report error #45350

Open
aytrack opened this issue Jul 13, 2023 · 1 comment
Open

change partition key attribute report error #45350

aytrack opened this issue Jul 13, 2023 · 1 comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.

Comments

@aytrack
Copy link
Contributor

aytrack commented Jul 13, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE quarterly_report_status (
    report_id INT NOT NULL,
    report_status VARCHAR(20) NOT NULL,
    report_updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
PARTITION BY RANGE ( UNIX_TIMESTAMP(report_updated) ) (
    PARTITION p0 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-01-01 00:00:00') ),
    PARTITION p1 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-04-01 00:00:00') ),
    PARTITION p2 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-07-01 00:00:00') ),
    PARTITION p3 VALUES LESS THAN ( UNIX_TIMESTAMP('2008-10-01 00:00:00') ),
    PARTITION p4 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-01-01 00:00:00') ),
    PARTITION p5 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-04-01 00:00:00') ),
    PARTITION p6 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-07-01 00:00:00') ),
    PARTITION p7 VALUES LESS THAN ( UNIX_TIMESTAMP('2009-10-01 00:00:00') ),
    PARTITION p8 VALUES LESS THAN ( UNIX_TIMESTAMP('2010-01-01 00:00:00') ),
    PARTITION p9 VALUES LESS THAN (MAXVALUE)
);
alter table quarterly_report_status modify column  report_updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;

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

change success or report more clear error info

3. What did you see instead (Required)

[17:52:53]TiDB root:test> alter table quarterly_report_status modify column  report_updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
(1659, "Field 'report_updated' is of a not allowed type for this type of partitioning")

4. What is your TiDB version? (Required)

[18:02:19]TiDB root:test> select tidb_version();
+-----------------------------------------------------------+
| tidb_version()                                            |
+-----------------------------------------------------------+
| Release Version: v7.3.0-alpha                             |
| Edition: Community                                        |
| Git Commit Hash: 75444807abc9c50660a091a771942a38a1507bb3 |
| Git Branch: heads/refs/tags/v7.3.0-alpha                  |
| UTC Build Time: 2023-07-11 14:27:34                       |
| GoVersion: go1.20.5                                       |
| Race Enabled: false                                       |
| Check Table Before Drop: false                            |
| Store: tikv                                               |
+-----------------------------------------------------------+
1 row in set
Time: 0.003s
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/moderate component/tablepartition This issue is related to Table Partition of TiDB. labels Jul 13, 2023
@bb7133
Copy link
Member

bb7133 commented Jul 13, 2023

I think this is (for now) expected due to the current implementation limitations(see #38670).

I would like to change this issue to 'enhancement'. /cc @mjonss

@bb7133 bb7133 added type/enhancement The issue or PR belongs to an enhancement. and removed type/bug The issue is confirmed as a bug. severity/moderate labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants