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

git at icinga.org git at icinga.org
Mon Aug 29 12:22:52 CEST 2016


Module: icinga2
Branch: support/2.5
Commit: 9db1e5d717e5e0db44d52edc0762af3c66ae72a7
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=9db1e5d717e5e0db44d52edc0762af3c66ae72a7

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 486a816..dfc0176 100644
--- a/lib/db_ido_mysql/idomysqlconnection.cpp
+++ b/lib/db_ido_mysql/idomysqlconnection.cpp
@@ -362,6 +362,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