From 441eadb883639c875d25bd43a509e2d9f094ac58 Mon Sep 17 00:00:00 2001 From: "O. Libre" Date: Tue, 5 Nov 2019 06:12:07 +0100 Subject: [PATCH] Check if mysqli to avoid perturbing PostgreSQL with "SET SQL_BIG_SELECTS=1" --- htdocs/accountancy/customer/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index e14d6211cbc..744584f4a20 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -313,7 +313,9 @@ $sql .= $db->plimit($limit + 1, $offset); dol_syslog("accountancy/customer/list.php", LOG_DEBUG); // MAX_JOIN_SIZE can be very low (ex: 300000) on some limited configurations (ex: https://www.online.net/fr/hosting/online-perso) // This big SELECT command may exceed the MAX_JOIN_SIZE limit => Therefore we use SQL_BIG_SELECTS=1 to disable the MAX_JOIN_SIZE security -$db->query("SET SQL_BIG_SELECTS=1"); +if ($db->type == 'mysqli') { + $db->query("SET SQL_BIG_SELECTS=1"); +} $result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); @@ -590,7 +592,9 @@ if ($result) { } else { print $db->error(); } -$db->query("SET SQL_BIG_SELECTS=0"); // Enable MAX_JOIN_SIZE limitation +if ($db->type == 'mysqli') { + $db->query("SET SQL_BIG_SELECTS=0"); // Enable MAX_JOIN_SIZE limitation +} // Add code to auto check the box when we select an account print '