forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lp-1733049: Blackhole : Specified key was too long; max key length is…
… 1000 bytes The maximum innodb key length is 3500 what is hardcoded in ha_innobase::max_supported_key_length()). The maximum number of innodb indexes is configured with MAX_INDEXES macro (see also MAX_KEY definition). The same is currently implemented for blackhole storage engine. There is difference between 8.0 and earlier versions. 8.0 counts the actual key length as a multiplication of key length given from statement and the maximum symbol lenght of table's charset (see Create_field::create_length_to_internal_length()). That's why the key length in the test is divided by 4(the maximum symbol length in UTF-8). (cherry picked from commit 0d90d81)
- Loading branch information
1 parent
3b3bbbb
commit a62cffc
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE `t` ( | ||
`a` varchar(750) NOT NULL default '', | ||
PRIMARY KEY (`a`) | ||
) ENGINE=BLACKHOLE; | ||
DROP TABLE `t`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Bug 53588 test case. | ||
# | ||
# Create long enough index (between 1000 and 3500). 1000 is the old value, | ||
# 3500 is innodb value (see ha_innobase::max_supported_key_length()). Without | ||
# the fix the test will fail with "Specified key was too long" error. | ||
# | ||
# For 8.0 the actual key length is counted as a value from statement, | ||
# multiplied by the maximum symbol lenght of the key's charset. | ||
# | ||
--source include/have_blackhole.inc | ||
|
||
# As default test charset is UTF-8 with 4-byte maximum symbol length, the `a` | ||
# key length will be multiplied by 4 (750*4 = 3000) and compared with what | ||
# blackhole storage engine returns from | ||
# ha_blackhole::max_supported_key_length(), that is why we need to reduce | ||
# the initial key length (3000) by 4 times to pass the test. | ||
CREATE TABLE `t` ( | ||
`a` varchar(750) NOT NULL default '', | ||
PRIMARY KEY (`a`) | ||
) ENGINE=BLACKHOLE; | ||
|
||
DROP TABLE `t`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters