diff -Nru cacti-spine-0.8.8b/debian/changelog cacti-spine-0.8.8b/debian/changelog --- cacti-spine-0.8.8b/debian/changelog 2016-04-05 16:47:05.000000000 +0200 +++ cacti-spine-0.8.8b/debian/changelog 2016-05-14 21:24:37.000000000 +0200 @@ -1,3 +1,10 @@ +cacti-spine (0.8.8b-1ubuntu2) xenial; urgency=medium + + * Add make_spine_sql_mode-strict_compatible.patch to enable cacti-spine + to work with the default settings of MySQL 5.7 (LP: #1578144) + + -- Paul Gevers Sat, 14 May 2016 21:24:30 +0200 + cacti-spine (0.8.8b-1ubuntu1) xenial; urgency=medium * Rebuild against libmysqlclient20. diff -Nru cacti-spine-0.8.8b/debian/patches/make_spine_sql_mode-strict_compatible.patch cacti-spine-0.8.8b/debian/patches/make_spine_sql_mode-strict_compatible.patch --- cacti-spine-0.8.8b/debian/patches/make_spine_sql_mode-strict_compatible.patch 1970-01-01 01:00:00.000000000 +0100 +++ cacti-spine-0.8.8b/debian/patches/make_spine_sql_mode-strict_compatible.patch 2016-05-14 19:40:31.000000000 +0200 @@ -0,0 +1,35 @@ +Description: Since MySQL 5.7 sql_mode is by default set to strict + mode. However, cacti is not designed to be compatible. So to enable cacti to + keep working, it needs to force NO_ZERO_DATE to be unset. +Author: Paul Gevers +Bug: http://bugs.cacti.net/view.php?id=2159 +Ubuntu-bug: https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/1578144 + +Index: spine/poller.c +=================================================================== +--- spine.orig/poller.c ++++ spine/poller.c +@@ -171,6 +171,9 @@ void poll_host(int host_id, int host_thr + + db_connect(set.dbdb, &mysql); + ++ /* Since MySQL 5.7 the sql_mode defaults are too strict for cacti */ ++ db_insert(&mysql, "SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', ''))"); ++ + /* allocate host and ping structures with appropriate values */ + if (!(host = (host_t *) malloc(sizeof(host_t)))) { + die("ERROR: Fatal malloc error: poller.c host struct!"); +Index: spine/spine.c +=================================================================== +--- spine.orig/spine.c ++++ spine/spine.c +@@ -465,6 +465,9 @@ int main(int argc, char *argv[]) { + /* connect to database */ + db_connect(set.dbdb, &mysql); + ++ /* Since MySQL 5.7 the sql_mode defaults are too strict for cacti */ ++ db_insert(&mysql, "SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', ''))"); ++ + if (set.log_level == POLLER_VERBOSITY_DEBUG) { + SPINE_LOG_DEBUG(("Version %s starting", VERSION)); + }else{ diff -Nru cacti-spine-0.8.8b/debian/patches/series cacti-spine-0.8.8b/debian/patches/series --- cacti-spine-0.8.8b/debian/patches/series 2016-04-01 13:59:20.000000000 +0200 +++ cacti-spine-0.8.8b/debian/patches/series 2016-05-14 14:40:08.000000000 +0200 @@ -2,3 +2,4 @@ 04-snmp-libdir.patch build_man_from_help.patch libmysqlclient_r +make_spine_sql_mode-strict_compatible.patch