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

Incorrect partition name is not resulting error in Tidb. #31535

Closed
ramanich1 opened this issue Jan 10, 2022 · 5 comments · Fixed by #31785
Closed

Incorrect partition name is not resulting error in Tidb. #31535

ramanich1 opened this issue Jan 10, 2022 · 5 comments · Fixed by #31785
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@ramanich1
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1;
create table t1 (a int) partition by list(a) (partition `s1 s2 ` values in (0), partition `s1 s2` values in (2));
USE information_schema;
SELECT table_name,partition_name  FROM partitions WHERE table_schema='test' AND table_name='t1' and partition_name ='s1 s2';
use test;

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

mysql> create table t1 (a int) partition by list(a) (partition `s1 s2 ` values in (0), partition `s1 s2` values in (2));
ERROR 1567 (HY000): Incorrect partition name

mysql> SELECT table_name,partition_name  FROM partitions WHERE table_schema='test' AND table_name='t1' and partition_name ='s1 s2';
Empty set (0.00 sec)

3. What did you see instead (Required)

mysql> create table t1 (a int) partition by list(a) (partition `s1 s2 ` values in (0), partition `s1 s2` values in (2));
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT table_name,partition_name  FROM partitions WHERE table_schema='test' AND table_name='t1' and partition_name ='s1 s2';
+------------+----------------+
| table_name | partition_name |
+------------+----------------+
| t1         | s1 s2          |
| t1         | s1 s2          |
+------------+----------------+
2 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

| Release Version: v5.4.0-alpha-264-g6efa36df6
Edition: Community
Git Commit Hash: 6efa36df6cff325106f67ecfe3d79816ba37ca6a
Git Branch: master
UTC Build Time: 2021-12-28 02:03:55
GoVersion: go1.17.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
@ramanich1 ramanich1 added the type/bug The issue is confirmed as a bug. label Jan 10, 2022
@ramanich1
Copy link
Collaborator Author

ramanich1 commented Jan 10, 2022

Please note that :

create table t1 (a int) partition by list (a) (partition `s1 s2 ` values in (0)); 
 --- `s1 s2 ` is treated as incorrect partition name in mysql . Tidb it's valid.
create table t1 (a int) partition by list (a)(partition `s1 s2` values in (0)); 
-- `s1 s2`Valid in both mysql and Tidb.

@ChenPeng2013 ChenPeng2013 added the sig/sql-infra SIG: SQL Infra label Jan 11, 2022
@mjonss
Copy link
Contributor

mjonss commented Jan 12, 2022

/assign

@mjonss
Copy link
Contributor

mjonss commented Jan 12, 2022

/component tablepartition

@ti-chi-bot ti-chi-bot added the component/tablepartition This issue is related to Table Partition of TiDB. label Jan 12, 2022
@hawkingrei hawkingrei added affects-5.4 This bug affects the 5.4.x(LTS) versions. severity/major labels Feb 12, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. labels Feb 14, 2022
@mjonss
Copy link
Contributor

mjonss commented Feb 14, 2022

/label affects-5.3

@ti-chi-bot ti-chi-bot added affects-5.3 This bug affects 5.3.x versions. and removed may-affects-5.3 This bug maybe affects 5.3.x versions. labels Feb 14, 2022
@mjonss
Copy link
Contributor

mjonss commented Feb 14, 2022

This affects all versions since v3.0.20 including v3.1.2, v4.0.16, v5.0.6, v5.1.3, v5.2.3, v5.3.0 and v5.4.0.

But I don't consider it to be a major bug, but rather moderate or even minor.

@hawkingrei hawkingrei added severity/moderate affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. and removed severity/major labels Feb 14, 2022
@ti-chi-bot ti-chi-bot removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. labels Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. 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.

5 participants