[icinga-checkins] icinga.org: icinga2/master: Improve support for MySQL >=5.7

git at icinga.org git at icinga.org
Sat Aug 27 10:29:17 CEST 2016


Module: icinga2
Branch: master
Commit: 4dbc07e2bc50ed0f3a449a0747baa438003c326e
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=4dbc07e2bc50ed0f3a449a0747baa438003c326e

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Aug 27 10:20:34 2016 +0200

Improve support for MySQL >=5.7

fixes #12558

---

 lib/db_ido_mysql/idomysqlconnection.cpp   |    2 ++
 lib/db_ido_mysql/schema/upgrade/2.5.0.sql |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp
index 5f9cfaa..7b41539 100644
--- a/lib/db_ido_mysql/idomysqlconnection.cpp
+++ b/lib/db_ido_mysql/idomysqlconnection.cpp
@@ -361,6 +361,8 @@ void IdoMysqlConnection::Reconnect(void)
 	/* set session time zone to utc */
 	Query("SET SESSION TIME_ZONE='+00:00'");
 
+	Query("SET SESSION SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");
+
 	Query("BEGIN");
 
 	/* update programstatus table */
diff --git a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
index 2aae0ba..766f5cb 100644
--- a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
+++ b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
@@ -7,6 +7,8 @@
 -- Please check http://docs.icinga.org for upgrading information!
 -- -----------------------------------------
 
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
 -- -----------------------------------------
 -- #10069 IDO: check_source should not be a TEXT field
 -- -----------------------------------------



More information about the icinga-checkins mailing list