From 5223b529d1697034292060b1babe63fa0c5475d6 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 20 Jul 2017 12:03:39 +0000 Subject: [PATCH] dblayeroo: push the group_concat_max_len to maximum allowed git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3820 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayeroo.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dblayeroo.php b/dblayeroo.php index 1ae9cda..0af657c 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -147,6 +147,16 @@ class dblayeroo $this->sep = "`"; if ($this->databasename () === null) $this->DBException ("No Database provided in DSN"); + // Force the GROUP_CONCAT value max to the max allowed from the server + $st = self::$instance[$this->dsn]->query ( + "SHOW VARIABLES LIKE 'max_allowed_packet'", PDO::FETCH_COLUMN, 1); + $rows = $st->fetchAll (); + if (! isset ($rows[0])) + throw new \Exception ( + "Can't read the max_allowed_packet from the MySQL server", 500); + $max_allowed_packet = $rows[0]; + self::$instance[$this->dsn]->exec ( + "SET SESSION group_concat_max_len = $max_allowed_packet"); break; case "pgsql": if (! array_key_exists ($this->dsn, self::$instance))