diff options
| author | Paul Gevers <elbrus@debian.org> | 2016-06-02 20:24:00 (GMT) |
|---|---|---|
| committer | Paul Gevers <elbrus@debian.org> | 2016-06-02 20:24:00 (GMT) |
| commit | 82150a56c51cbdb82e9f6f8e7136b1a939d7dffe (patch) | |
| tree | 3d2073fd55b0c4707749933d13df0204bdfdddf3 | |
| parent | 06fad62950a705bce67fbc9b87e06e54e416d7f9 (diff) | |
Also drop ONLY_FULL_GROUP_BY to be more strict sql_mode compatible
| -rw-r--r-- | debian/patches/make_cacti_sql_mode-strict_compatible.patch | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/debian/patches/make_cacti_sql_mode-strict_compatible.patch b/debian/patches/make_cacti_sql_mode-strict_compatible.patch index ce4d3dc..5d35d54 100644 --- a/debian/patches/make_cacti_sql_mode-strict_compatible.patch +++ b/debian/patches/make_cacti_sql_mode-strict_compatible.patch @@ -1,9 +1,11 @@ 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. + keep working, it needs to force NO_ZERO_DATE and ONLY_FULL_GROUP_BY to be + unset. Author: Paul Gevers <elbrus@debian.org> Bug: http://bugs.cacti.net/view.php?id=2159 -Ubuntu-bug: https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/1578144 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/1578144 +Applied-Upstream: commit:e6337e28f6fd35092d60cb87e3038461065c59f7 commit:b068b29251d0b4496abcd5be8a7cbcd3c290b227 Index: cacti/cacti.sql =================================================================== @@ -22,11 +24,12 @@ Index: cacti/lib/database.php =================================================================== --- cacti.orig/lib/database.php +++ cacti/lib/database.php -@@ -51,6 +51,7 @@ function db_connect_real($host, $user, $ +@@ -51,6 +51,8 @@ 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', ''))"); ++ $cnn_id->EXECUTE("SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY', ''))"); return($cnn_id); } |
