You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
Assignee: crfriend
Status: Resolved (closed on 2012-11-28 15:11:15 +00:00)
Target Version: 1.8.2
Last Update: 2014-12-08 14:35:05 +00:00 (in Redmine)
Icinga Version: 1.8.2
OS Version: Solaris 10, but others likely affected
The use of "FROM_UNIXTIME(NULL)" syntax in older versions of MySQL results in a NULL value being passed in inserts to tables where NULL values are disallowed for the affected column. E.g.:
I suggest the use of "0000-00-00 00:00:00" which is explicitly legal and not NULL.
Patch attached. And, yes, I do agree with the assertion in the comment in the code.
My assertion of "High" priority is because the issue causes problems for anybody using older versions of MySQL with the default db schema for Icinga. (And, unless running very recent patches, memory leaks.)
idoutils: fix FROM_UNIXTIME(NULL) does not work with MySQL 5.0.x refs #3399 refs #3466
basically, we treated the inner 0L as NULL, as otherwise out-of-range
warnings would be expected. since this workaround does not work with
with mysql 5.0.x we must learn it the hard way, replacing 0L directly
with the null timestamp like NULL in mysql >= 5.1.x would automatically
create on schema insert - 0000-00-00 00:00:00
kudos to Carl for the patch and fix.
The text was updated successfully, but these errors were encountered:
This issue has been migrated from Redmine: https://dev.icinga.com/issues/3466
Created by crfriend on 2012-11-26 22:07:37 +00:00
Assignee: crfriend
Status: Resolved (closed on 2012-11-28 15:11:15 +00:00)
Target Version: 1.8.2
Last Update: 2014-12-08 14:35:05 +00:00 (in Redmine)
The use of "FROM_UNIXTIME(NULL)" syntax in older versions of MySQL results in a NULL value being passed in inserts to tables where NULL values are disallowed for the affected column. E.g.:
Nov 26 16:35:25 t1 ido2db[12368]: [ID 827216 user.info] Error: database query failed for 'INSERT INTO icinga_programstatus (instance_id, status_update_time, program_start_time, is_currently_running, process_id, daemon_mode, last_command_check, last_log_rotation, notifications_enabled, active_service_checks_enabled, passive_service_checks_enabled, active_host_checks_enabled, passive_host_checks_enabled, event_handlers_enabled, flap_detection_enabled, failure_prediction_enabled, process_performance_data, obsess_over_hosts, obsess_over_services, modified_host_attributes, modified_service_attributes, global_host_event_handler, global_service_event_handler, disable_notif_expire_time) VALUES (1, FROM_UNIXTIME(1353965725), FROM_UNIXTIME(1353886511), '1', 12369, 1, FROM_UNIXTIME(1353965716), FROM_UNIXTIME(1353906000), 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, '', '', FROM_UNIXTIME(NULL))' - '1048: Column 'disable_notif_expire_time' cannot be null'
I suggest the use of "0000-00-00 00:00:00" which is explicitly legal and not NULL.
Patch attached. And, yes, I do agree with the assertion in the comment in the code.
My assertion of "High" priority is because the issue causes problems for anybody using older versions of MySQL with the default db schema for Icinga. (And, unless running very recent patches, memory leaks.)
Attachments
Changesets
2012-11-28 14:53:21 +00:00 by mfriedrich 1042107
The text was updated successfully, but these errors were encountered: