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:
@@ -147,6 +147,16 @@ class dblayeroo
|
|||||||
$this->sep = "`";
|
$this->sep = "`";
|
||||||
if ($this->databasename () === null)
|
if ($this->databasename () === null)
|
||||||
$this->DBException ("No Database provided in DSN");
|
$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;
|
break;
|
||||||
case "pgsql":
|
case "pgsql":
|
||||||
if (! array_key_exists ($this->dsn, self::$instance))
|
if (! array_key_exists ($this->dsn, self::$instance))
|
||||||
|
|||||||
Reference in New Issue
Block a user