From 4ff22710b470afdd74b2438c17247e74a34b8d8c Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Fri, 3 Sep 2021 08:26:35 +0530 Subject: [PATCH 1/2] MySQL sql_mode change --- source/upgrading/upgrade/upgrade_notes.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/upgrading/upgrade/upgrade_notes.rst b/source/upgrading/upgrade/upgrade_notes.rst index 55a628871f..ef43a11551 100644 --- a/source/upgrading/upgrade/upgrade_notes.rst +++ b/source/upgrading/upgrade/upgrade_notes.rst @@ -101,3 +101,18 @@ added in CloudStack's db.properties file: db.cloud.driver=jdbc:mysql db.usage.driver=jdbc:mysql + + +MySQL 8.0 sql mode change +------------------------- + +MySQL mode (sql_mode) has changed in CloudStack db.properties to "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION". +This gets automatically applies to the MySQL session used by CloudStack management server. + +If the admin uses MySQL directly and wants to query tables it is advised to change the sql_mode in the corresponding session or globally. + +Eg. mysql> set global sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; + Query OK, 0 rows affected (0.00 sec) + + mysql> set sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; + Query OK, 0 rows affected (0.00 sec) \ No newline at end of file From 3bad33dd2a6d0c774a0e4ec90b6f858310206f6a Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Fri, 3 Sep 2021 09:29:08 +0530 Subject: [PATCH 2/2] Fixed formatting --- source/upgrading/upgrade/upgrade_notes.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/upgrading/upgrade/upgrade_notes.rst b/source/upgrading/upgrade/upgrade_notes.rst index ef43a11551..7b2b7d1567 100644 --- a/source/upgrading/upgrade/upgrade_notes.rst +++ b/source/upgrading/upgrade/upgrade_notes.rst @@ -106,13 +106,18 @@ added in CloudStack's db.properties file: MySQL 8.0 sql mode change ------------------------- -MySQL mode (sql_mode) has changed in CloudStack db.properties to "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION". +MySQL mode (sql_mode) has changed in CloudStack db.properties to +"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, +ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION". + This gets automatically applies to the MySQL session used by CloudStack management server. If the admin uses MySQL directly and wants to query tables it is advised to change the sql_mode in the corresponding session or globally. -Eg. mysql> set global sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; +Eg. mysql> set global sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, + "> ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; Query OK, 0 rows affected (0.00 sec) - mysql> set sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; + mysql> set sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, + "> ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"; Query OK, 0 rows affected (0.00 sec) \ No newline at end of file