From 4651165e4d415167f6eef4e755c2a5e63ce59ba6 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Wed, 29 Mar 2017 19:45:21 +0200 Subject: [PATCH] DB/SQL-Modes * force disable special modes that will prevent our funny queries --- includes/database.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/database.class.php b/includes/database.class.php index bd0aead1..de2e2f91 100644 --- a/includes/database.class.php +++ b/includes/database.class.php @@ -36,9 +36,12 @@ class DB if ($options['prefix']) $interface->setIdentPrefix($options['prefix']); - // kill STRICT_TRANS_TABLES and STRICT_ALL_TABLES off. It prevents usage of implicit default values. + // disable STRICT_TRANS_TABLES and STRICT_ALL_TABLES off. It prevents usage of implicit default values. if ($idx == DB_AOWOW) - $interface->query('SET SESSION sql_mode = \'NO_ENGINE_SUBSTITUTION\''); + $interface->query("SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION'"); + // disable ONLY_FULL_GROUP_BY (Allows for non-aggregated selects in a group-by query) + else + $interface->query("SET SESSION sql_mode = ''"); self::$interfaceCache[$idx] = &$interface; self::$connectionCache[$idx] = true;