dblayeroo: manage correctely the PGSQL string_agg (instead of GROUP_CONCAT)
dblayeroo: Manage correctely the Aliases (do not emit Notice in execute) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3899 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -765,8 +765,12 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat ( group ) ");
|
||||
$res = $tbl1->displayGet ();
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(".$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull4 ()
|
||||
@@ -775,9 +779,14 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat (distinct group ) ");
|
||||
$res = $tbl1->displayGet ();
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_NotFull5 ()
|
||||
@@ -787,10 +796,16 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat (distinct group ) ", "Group Alias");
|
||||
$res = $tbl1->displayGet ();
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full1 ()
|
||||
@@ -822,9 +837,14 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat ( group ) ");
|
||||
$res = $tbl1->displayGet (true);
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(".$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(".$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full4 ()
|
||||
@@ -833,10 +853,16 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat (distinct group ) ");
|
||||
$res = $tbl1->displayGet (true);
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().")"), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Full5 ()
|
||||
@@ -846,11 +872,18 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$tbl1->displayAdd ("group_concat (distinct group ) ", "Group Alias");
|
||||
$res = $tbl1->displayGet (true);
|
||||
$tbl1->disconnect ();
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
if ($this->engine === "pgsql")
|
||||
$this->assertSame (array (
|
||||
"order1" => "string_agg(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
else
|
||||
$this->assertSame (array (
|
||||
"order1" => "GROUP_CONCAT(DISTINCT ".
|
||||
$tbl1->sep()."groupedoo".$tbl1->sep().".".
|
||||
$tbl1->sep()."group".$tbl1->sep().") AS ".
|
||||
$tbl1->sep()."Group Alias".$tbl1->sep()), $res);
|
||||
}
|
||||
|
||||
public function test_displayAdd_Multiple1 ()
|
||||
@@ -865,6 +898,7 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
$res);
|
||||
}
|
||||
|
||||
|
||||
public function test_update5 ()
|
||||
{
|
||||
// Manage to update the non unique fields
|
||||
@@ -890,4 +924,14 @@ class test_dblayeroo_{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
->execute ();
|
||||
$tbl1->disconnect ();
|
||||
}
|
||||
|
||||
public function test_displayAdd_ComaFields1 ()
|
||||
{
|
||||
$tbl1 = $this->tbl1 ();
|
||||
$tbl1->displayAdd ("group_concat (group ),group ",
|
||||
"Group Alias,Group2");
|
||||
$res = $tbl1->select ()
|
||||
->execute ();
|
||||
$tbl1->disconnect ();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user