[ZBX-6936] insert into mysql 5.6 table failed because TEXT columns cannot be assigned a default value Created: 2013 Aug 29  Updated: 2017 May 30  Resolved: 2013 Sep 03

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P)
Affects Version/s: 2.0.8
Fix Version/s: 2.0.9rc1, 2.1.4

Type: Incident report Priority: Critical
Reporter: Eugene Turovsky Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: mysql
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux, MySQL-server-5.6.13



 Description   

I try create new item on proxy host with mysql database 5.6.13 (zabbix-proxy 2.0.8). Item don't have field 'Description'. Log error on proxy:
[Z3005] query failed: [1364] Field 'description' doesn't have a default value [insert into items (itemid,type,snmp_community,snmp_oid,hostid,key_,delay,status,value_type,trapper_hosts,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,filter,interfaceid,port) values (100100000023641,3,'','',100100000010100,'icmppingsec[]',30,0,0,'','',0,'','','1','','','','',0,0,'','','','',0,'',100100000000010,'');
and also:
[Z3005] query failed: [1364] Field 'test_string' doesn't have a default value [insert into regexps (regexpid,name) values (1001000000
00001,'File systems for discovery');

This work on 5.1 database, but on MySQL 5.6 TEXT columns cannot be assigned a default value, that is if insert don't have 'description' column in statement, query is failed.
I think it can be fix these ways:

  • allow in schema.sql null values for text columns, changing these columns (text):
    `description` text NOT NULL, to: `description` text,
  • or add empty value explicitly in every insert for these columns, for example:
    insert into regexps (regexpid,name,test_string) values (100100000000001,'File systems for discovery','');


 Comments   
Comment by Alexander Vladishev [ 2013 Aug 30 ]

I confirm the issue.

Comment by Alexander Vladishev [ 2013 Sep 02 ]

Fixed in the development branches:

  • svn://svn.zabbix.com/branches/dev/ZBX-6936
  • svn://svn.zabbix.com/branches/dev/ZBX-6936-trunk
Comment by Andris Zeila [ 2013 Sep 02 ]

Successfully tested

Comment by Alexander Vladishev [ 2013 Sep 02 ]

Fixed in pre-2.0.9 r38274 and pre-2.1.4 (trunk) r38275.

Generated at Wed Apr 24 06:29:37 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.