From: Joe Date: Sun, 4 May 2014 07:46:12 +0000 (+0200) Subject: Backward compatible empty sql mode for MySql databases greater than release 5.5. X-Git-Tag: 2.3-final~143 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=35a4e1c738ff76d3898efa790013936f542e31d1;p=fa-stable.git Backward compatible empty sql mode for MySql databases greater than release 5.5. --- diff --git a/includes/db/connect_db.inc b/includes/db/connect_db.inc index b0c33f64..5b4293eb 100644 --- a/includes/db/connect_db.inc +++ b/includes/db/connect_db.inc @@ -26,6 +26,15 @@ function set_global_connection($company=-1) $db = mysql_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"]); mysql_select_db($connection["dbname"], $db); + ///// From MySql release 5.6.6 the sql_mode is no longer empty as it was prior to + ///// this release. Just for safety we set it empty for all 5.6 release and higher. + ///// This non empty sql_mode values can interphere with FA, so all is set empty during + ///// our sessions. + ///// We are, however, investigating the existing code to be compatible in the future. + ///// We are also working on a mysql/mysqli solution to go to release 2.4. + if (strncmp(mysql_get_server_info(), "5.6", 3) >= 0) + db_query("SET sql_mode = ''"); + ///// return $db; }