| Bug #12160 | Create Table with PARTITION BY KEY on CHAR(8) NOT NULL, returns error 140 | ||
|---|---|---|---|
| Submitted: | 25 Jul 2005 19:00 | Modified: | 17 Feb 2006 12:21 |
| Reporter: | Jonathan Miller | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.1 | OS: | Linux (Linux) |
| Assigned to: | Jon Stephens | CPU Architecture: | Any |
[25 Jul 2005 21:29]
Jonathan Miller
The database has to created using COLLATION Latin1_bin in order for the create table to work correctly.
[26 Jul 2005 7:01]
Mikael Ronström
It is correct that BY KEY doesn't support CHAR(8) with any other character set than binary character set. I'll investigate whether it is easy or difficult to enable it also for general character sets.
[30 Sep 2005 9:09]
Jon Stephens
Reassigning to myself, changing status to Analysing - I'll determine if this needs to go into Partitioning docs now in preparation.
[17 Feb 2006 12:21]
Jon Stephens
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: AFAIK, the partitioning function must return an integer, so I've marked this as !Bug.

Description: Testing for the next Alcatel drop, I found that the query below returns error 140 "Can't create table ": drop table if exists ServiceCodeMnemonic; create table ServiceCodeMnemonic ( serviceCodeMnemonicId CHAR(8) NOT NULL, mobileNetworkCodeId BINARY(3) NOT NULL, mobileCountryCodeId BINARY(3) NOT NULL, belongToBscLink BINARY(9), restrictedApplicabillity TINYINT, basicServiceCategory TINYINT, gsmBearerCapabilityData BINARY(27), enableMultiMediaTcCall TINYINT, rowidGBC TINYINT, PRIMARY KEY USING HASH (serviceCodeMnemonicId,mobileNetworkCodeId,mobileCountryCodeId) ) engine=ndb PARTITION BY KEY (serviceCodeMnemonicId); If you change it to PARTITION BY KEY (mobileNetworkCodeId) it works fine. How to repeat: Run inside cluster from MySQL client: drop table if exists ServiceCodeMnemonic; create table ServiceCodeMnemonic ( serviceCodeMnemonicId CHAR(8) NOT NULL, mobileNetworkCodeId BINARY(3) NOT NULL, mobileCountryCodeId BINARY(3) NOT NULL, belongToBscLink BINARY(9), restrictedApplicabillity TINYINT, basicServiceCategory TINYINT, gsmBearerCapabilityData BINARY(27), enableMultiMediaTcCall TINYINT, rowidGBC TINYINT, PRIMARY KEY USING HASH (serviceCodeMnemonicId,mobileNetworkCodeId,mobileCountryCodeId) ) engine=ndb PARTITION BY KEY (serviceCodeMnemonicId);