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))