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

Incorrect query in upgrade script to 2.0

XMLWordPrintable

      cat upgrades/dbpatches/2.0/mysql/patch.sql | mysql zabbix
      the following error accures:
      ERROR 1452 (23000) at line 104: Cannot add or update a child row: a foreign key constraint fails (`zabbix`.<result 2 when explaining filename '#sql-7d6d_2'>, CONSTRAINT `c_config_2` FOREIGN KEY (`discovery_groupid`) REFERENCES `groups` (`groupid`))

      Whereas "discovery_groupid" column modified to NOT NULL, then executes the next query:
      UPDATE config SET discovery_groupid=NULL WHERE NOT discovery_groupid IN (SELECT groupid FROM groups);

      The "discovery_groupid" column can not be NULL.

      The problem may happen when discovery_groupid references to non exist groupid.

            Unassigned Unassigned
            dotneft Alexey Pustovalov
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: