[ZBX-11241] Index problem_tag_2 - Specified key was too long Created: 2016 Sep 19  Updated: 2017 May 30  Resolved: 2016 Sep 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Marcel Jäpel Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: database, dbpatches, upgrade
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:
  • Debian 8 x64
  • MySQL 5.5.52 (InnoDB disabled)
  • Upgrade Zabbix from 3.0.4 to 3.2.0


 Description   

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



 Comments   
Comment by Alexander Vladishev [ 2016 Sep 20 ]

Zabbix does not support MyISAM engine.

I close this issue as "Won't Fix".

Generated at Thu Apr 25 10:50:05 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.