Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23530

ERROR 1071: Specified key was too long; max key length is 1000/2000 bytes on CREATE TABLE ... UNIQUE KEY ... USING HASH

    XMLWordPrintable

Details

    Description

      # First 3 succeed, last one fails with 'ERROR 1071 (42000): Specified key was too long; max key length is 2000 bytes'
      CREATE TABLE t1(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=InnoDB;
      CREATE TABLE t2(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=MyISAM;
      CREATE TABLE t3(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=MEMORY;
      CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      

      Leads to:

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Optimized)

      10.5.6>CREATE TABLE t1(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.013 sec)
      10.5.6>CREATE TABLE t2(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=MyISAM;
      Query OK, 0 rows affected (0.002 sec)
      10.5.6>CREATE TABLE t3(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=MEMORY;
      Query OK, 0 rows affected (0.002 sec)
      10.5.6>CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      ERROR 1071 (42000): Specified key was too long; max key length is 2000 bytes
      

      10.4.15 eae968f62d285de97ed607c87bc131cd863d5d03 (Optimized)

      10.4.15>CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes
      

      Also note the 1000 vs 2000 inconsistency between 10.4 and 10.5

      It is a regression:

      10.3.25 bafc5c1321a7dff5f2da292111bf98fed9d1658d (Optimized)

      10.3.25>CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      Query OK, 0 rows affected (0.012 sec)
      

      10.2.34 (Optimized)

      10.2.34>CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      Query OK, 0 rows affected (0.01 sec)
      

      10.1.47 (Optimized)

      10.1.47>CREATE TABLE t4(c CHAR(1), UNIQUE KEY i(c) USING HASH) ENGINE=Aria;
      Query OK, 0 rows affected (0.01 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.