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
This commit is contained in:
2017-07-20 12:03:39 +00:00
parent 36de4b3600
commit 5223b529d1

View File

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