Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-1126

LP #1733049: Blackhole : Specified key was too long; max key length is 1000 bytes

Details

    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

      { return BLACKHOLE_MAX_KEY; }

      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;

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist