diff -Nru cacti-0.8.8f+ds1/debian/changelog cacti-0.8.8f+ds1/debian/changelog --- cacti-0.8.8f+ds1/debian/changelog 2016-04-19 01:17:46.000000000 +0200 +++ cacti-0.8.8f+ds1/debian/changelog 2016-05-14 21:15:11.000000000 +0200 @@ -1,3 +1,10 @@ +cacti (0.8.8f+ds1-4ubuntu5) xenial; urgency=medium + + * Add make_cacti_sql_mode-strict_compatible.patch to enable cacti to + work with the default settings of MySQL 5.7 (LP: #1578144) + + -- Paul Gevers Sat, 14 May 2016 21:00:40 +0200 + cacti (0.8.8f+ds1-4ubuntu4) xenial; urgency=medium * debian/patches/11_1571432_mysqli.patch: Use mysqli extension not diff -Nru cacti-0.8.8f+ds1/debian/patches/make_cacti_sql_mode-strict_compatible.patch cacti-0.8.8f+ds1/debian/patches/make_cacti_sql_mode-strict_compatible.patch --- cacti-0.8.8f+ds1/debian/patches/make_cacti_sql_mode-strict_compatible.patch 1970-01-01 01:00:00.000000000 +0100 +++ cacti-0.8.8f+ds1/debian/patches/make_cacti_sql_mode-strict_compatible.patch 2016-05-14 21:12:18.000000000 +0200 @@ -0,0 +1,32 @@ +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: cacti/cacti.sql +=================================================================== +--- cacti.orig/cacti.sql ++++ cacti/cacti.sql +@@ -2,6 +2,8 @@ + -- Table structure for table `cdef` + -- + ++SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', '')) ; ++ + CREATE TABLE cdef ( + id mediumint(8) unsigned NOT NULL auto_increment, + hash varchar(32) NOT NULL default '', +Index: cacti/lib/database.php +=================================================================== +--- cacti.orig/lib/database.php ++++ cacti/lib/database.php +@@ -51,6 +51,7 @@ function db_connect_real($host, $user, $ + $cnn_id = ADONewConnection($dsn); + if ($cnn_id) { + $cnn_id->EXECUTE("set names 'utf8'"); ++ $cnn_id->EXECUTE("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', ''))"); + return($cnn_id); + } + diff -Nru cacti-0.8.8f+ds1/debian/patches/series cacti-0.8.8f+ds1/debian/patches/series --- cacti-0.8.8f+ds1/debian/patches/series 2016-04-19 01:17:46.000000000 +0200 +++ cacti-0.8.8f+ds1/debian/patches/series 2016-05-13 09:43:45.000000000 +0200 @@ -12,3 +12,4 @@ CVE-2015-8377-sql-injection-in-graph-php-host_new_graphs_save.patch CVE-2015-8604-sql-injection-in-graphs_new.patch 11_1571432_mysqli.patch +make_cacti_sql_mode-strict_compatible.patch