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 type to a not allowed type should report error #38616

Closed
aytrack opened this issue Oct 24, 2022 · 2 comments
Closed

change partition key type to a not allowed type should report error #38616

aytrack opened this issue Oct 24, 2022 · 2 comments
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Oct 24, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t1 (a tinyint, b char) partition by range (a) (
    partition p0 values less than (10)
);
alter table t1 modify a char;

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

MySQL test> alter table t1 modify a char;
(1659, "Field 'a' is of a not allowed type for this type of partitioning")

3. What did you see instead (Required)

TiDB root@127.0.0.1:test> alter table t1 modify a char;
show create Query OK, 0 rows affected
Time: 3.020s
TiDB root@127.0.0.1:test> show create table t1\G
***************************[ 1. row ]***************************
Table        | t1
Create Table | CREATE TABLE `t1` (
  `a` char(1) DEFAULT NULL,
  `b` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY RANGE (`a`)
(PARTITION `p0` VALUES LESS THAN (10))

1 row in set

4. What is your TiDB version? (Required)

TiDB root@127.0.0.1:test> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.4.0-alpha
Edition: Community
Git Commit Hash: 85b53e18781d459074f1637998014b37231283b0
Git Branch: heads/refs/tags/v6.4.0-alpha
UTC Build Time: 2022-10-22 14:24:45
GoVersion: go1.19.1
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv

1 row in set
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/moderate labels Oct 24, 2022
@jiyfhust
Copy link
Contributor

/assign

@mjonss
Copy link
Contributor

mjonss commented Dec 27, 2022

Fixed by #38670
Now returns:

tidb> alter table t1 modify a char;
ERROR 8200 (HY000): Unsupported modify column: table is partition table

@mjonss mjonss closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants