Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11241

Index problem_tag_2 - Specified key was too long

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Major Major
    • None
    • 3.2.0
    • Server (S)
    • - Debian 8 x64
      - MySQL 5.5.52 (InnoDB disabled)
      - Upgrade Zabbix from 3.0.4 to 3.2.0

      Hi,

      I tried to upgrade my small Zabbix environment from 3.0.4 to 3.2.0. MySQL with MyISAM is used. And the database upgrade failed with

       19091:20160919:202200.725 current database version (mandatory/optional): 03010037/03010037
       19091:20160919:202200.725 required mandatory version: 03020000
       19091:20160919:202200.725 starting automatic database upgrade
       19091:20160919:202200.726 [Z3005] query failed: [1071] Specified key was too long; max key length is 1000 bytes [create index problem_tag_2 on problem_tag (tag,value)]
       19091:20160919:202200.726 database upgrade failed
      

      Table was created with:

      mysql> show create table problem_tag \G
      *************************** 1. row ***************************
             Table: problem_tag
      Create Table: CREATE TABLE `problem_tag` (
        `problemtagid` bigint(20) unsigned NOT NULL,
        `eventid` bigint(20) unsigned NOT NULL,
        `tag` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
        `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
        PRIMARY KEY (`problemtagid`),
        KEY `problem_tag_1` (`eventid`)
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
      1 row in set (0.00 sec)
      
      mysql>
      

      Following Query works fine and Kombination 167+166 is the maximum for the key length in this case:

      create index problem_tag_2 on problem_tag (tag(167),value(166));
      

      So far as I know maximum key length of MySQL is not configurable. So upgrade logic need a check for this.

      Regards,
      Marcel

            Unassigned Unassigned
            marcel.japel Marcel Jäpel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: