Details
-
Bug
-
Status: Done
-
High
-
Resolution: Fixed
-
None
-
None
Description
**Reported in Launchpad by Nickolay Ihalainen last update 18-01-2018 11:12:15
With innodb_large_prefix=1 blackhole storage engine is incompatible with innodb table definitions,
thus adding new indexes breaking slave.
mysqltest: At line 3: query 'ALTER TABLE t ADD KEY (c)' failed: 1071: Specified key was too long; max key length is 1000 bytes
[email protected] percona-server]$ git diff
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index df10e7d..e265ccf 100644
— a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -66,7 +66,7 @@ public:
/* The following defines can be increased if necessary */
#define BLACKHOLE_MAX_KEY 64 /* Max allowed keys */
#define BLACKHOLE_MAX_KEY_SEG 16 /* Max segments for key */
-#define BLACKHOLE_MAX_KEY_LENGTH 1000
+#define BLACKHOLE_MAX_KEY_LENGTH 10000
uint max_supported_keys() const
uint max_supported_key_length() const
{ return BLACKHOLE_MAX_KEY_LENGTH; }uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
[[email protected] percona-server]$ cat mysql-test/t/blackhole_max_key_len.test
--source include/have_blackhole.inc
CREATE TABLE t(c varchar(255)) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ENGINE=blackhole;
ALTER TABLE t ADD KEY (c);
DROP TABLE t;[[email protected] percona-server]$ cat mysql-test/r/blackhole_max_key_len.result
CREATE TABLE t(c varchar(255)) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ENGINE=blackhole;
ALTER TABLE t ADD KEY (c);
DROP TABLE t;
[email protected] percona-server]$ cat mysql-test/r/blackhole_max_key_len.result
CREATE TABLE t(c varchar(255)) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ENGINE=blackhole;
ALTER TABLE t ADD KEY (c);
DROP TABLE t;