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

insert into mysql 5.6 table failed because TEXT columns cannot be assigned a default value

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.0.9rc1, 2.1.4
    • 2.0.8
    • Proxy (P)
    • linux, MySQL-server-5.6.13

      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','');

            Unassigned Unassigned
            samarit Eugene Turovsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: