Bug #57924 | crash when creating partitioned table with multiple columns in the partition key | ||
---|---|---|---|
Submitted: | 2 Nov 2010 12:22 | Modified: | 28 Jan 2011 12:10 |
Reporter: | Maitrayi Sabaratnam | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S3 (Non-critical) |
Version: | 5.1 | OS: | Any |
Assigned to: | Mattias Jonsson | CPU Architecture: | Any |
[2 Nov 2010 12:22]
Maitrayi Sabaratnam
[3 Nov 2010 11:48]
Sveta Smirnova
Thank you for the report. Verified as described: "please push fix in main tree"
[4 Nov 2010 13:32]
Jon Stephens
Hi Kostja, I'm changing the category from Parser to Partitioning, so that this will come to me for documentation rather than to Paul. (I'm already documenting the related Cluster BUG#53354.) Thanks!
[6 Dec 2010 11:38]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/126121 3512 Mattias Jonsson 2010-12-06 Bug#57924: crash when creating partitioned table with multiple columns in the partition key ndb crash if duplicate columns in the partitioning key. Backport from mysql-5.1-telco-7.0, see bug#53354. @ mysql-test/r/partition_error.result updated result @ mysql-test/t/partition_error.test Added test for the error in non-ndb partitioned table. @ sql/sql_partition.cc Added check for duplicated field names in the partitioning key.
[10 Jan 2011 12:45]
Magnus BlÄudd
CREATE TABLE t2(a int, b int, PRIMARY KEY(a, b, a)) => 1060: Duplicate column name 'a' CREATE TABLE t2(a int, b int, PRIMARY KEY(A, b, a)) => 1060: Duplicate column name 'a' CREATE TABLE t2(a int, b int, PRIMARY KEY(a, b, A)); => 1060: Duplicate column name 'A' CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) PARTITION BY KEY(a, b, a) => 1488: Field in list of fields for partition function not found in table CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) PARTITION BY KEY(a, b, A) => Success! I think we should use my_strcasecmp when comparing the field names. From 'mysql_prepare_create_table' in sql_table.cc /* Check if we have used the same field name before */ for (dup_no=0; (dup_field=it2++) != sql_field; dup_no++) { if (my_strcasecmp(system_charset_info, sql_field->field_name, dup_field->field_name) == 0)
[10 Jan 2011 15:22]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128325 3512 Mattias Jonsson 2011-01-10 Bug#57924: crash when creating partitioned table with multiple columns in the partition key ndb crash if duplicate columns in the partitioning key. Backport from mysql-5.1-telco-7.0, see bug#53354. Changed from case sensitive field name comparision to non case sensitive too. @ mysql-test/r/partition_error.result updated result @ mysql-test/t/partition_error.test Added test for the error in non-ndb partitioned table. @ sql/sql_partition.cc Added check for duplicated field names in the partitioning key.
[10 Jan 2011 15:24]
Mattias Jonsson
Great catch Magnus, I've updated the patch.
[26 Jan 2011 20:15]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:mattias.jonsson@oracle.com-20110126201331-ab82uv7s5qmdufs5) (version source revid:mattias.jonsson@oracle.com-20110126201331-ab82uv7s5qmdufs5) (merge vers: 5.6.2) (pib:24)
[26 Jan 2011 20:16]
Bugs System
Pushed into mysql-5.5 5.5.10 (revid:mattias.jonsson@oracle.com-20110126183353-8fngni1uuyybmz9u) (version source revid:mattias.jonsson@oracle.com-20110126183353-8fngni1uuyybmz9u) (merge vers: 5.5.10) (pib:24)
[26 Jan 2011 20:16]
Bugs System
Pushed into mysql-5.1 5.1.56 (revid:mattias.jonsson@oracle.com-20110126155021-evjpfdciphnd50sy) (version source revid:mattias.jonsson@oracle.com-20110126155021-evjpfdciphnd50sy) (merge vers: 5.1.56) (pib:24)
[26 Jan 2011 20:18]
Mattias Jonsson
Note that the code is pushed into 5.1 only (the code was null-merged to 5.5 because the bug did not exists there, it was fixed by the COLUMNS partitioning feature.) The test was merged through 5.5 up to trunk though.
[27 Jan 2011 16:45]
Jon Stephens
See BUG#53354 for docs info. Closed.
[28 Jan 2011 12:10]
Jon Stephens
Already documented. Set back to Closed.