Wrong INDEX in MySQL database causes mysql_query errors

Bug #634995 reported by Oliver Rompcik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ndoutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: ndoutils-nagios3-mysql

After connection to the database, /var/log/messages reports a problem with the database:

ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_configfilevariables SET instance_id='1', configfile_id='1', varname='cfg_file', varvalue='/etc/nagios3/objects/printer\.cfg''
...
ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_configfilevariables SET instance_id='1', configfile_id='1', varname='cfg_file', varvalue='/etc/nagios3/objects/windows\.cfg''

This is due to a wrong uniqueness in the DB, a new INDEX eliminates the Problem:

ALTER TABLE nagios_configfilevariables DROP INDEX instance_id;
ALTER TABLE nagios_configfilevariables ADD INDEX instance_id (instance_id, configfile_id, varname);

Bug seems to originate from source 1.4b7, later Versions of ndoutils (1.4b8 and 1.4b9) seem not to be affected.

Tags: lucid lynx
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.