dblayeroo : do not add the not needed GROUP BY

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3826 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2017-07-25 08:57:29 +00:00
parent e98686d91c
commit eea451b131

View File

@@ -1574,7 +1574,7 @@ class dblayeroo
$aggregateFunction = true;
// Aggregate function. Add the non aggregate fields to the GROUP BY
// expression, if not already done
if ($this->groupByExpression === array ())
if ($this->groupByExpression === null)
{
$this->groupByExpression = $this->displayColumn;
}
@@ -1609,7 +1609,7 @@ class dblayeroo
else
$this->displayColumn[$getSortOrder] =
"$func($distinct$this->sep$fieldName$this->sep$separator)";
if ($this->groupByExpression !== array () && ! isset ($aggregateFunction))
if ($this->groupByExpression !== null && ! isset ($aggregateFunction))
{
// Not a aggregate function, but groupBy is set : add the new field name
$this->groupByExpression[$getSortOrder] =
@@ -2539,7 +2539,7 @@ class dblayeroo
if (! in_array ($this->primary, $uniques))
$uniques = array_merge (array ($this->primary), $uniques);
$setValues = $values;
$foundImpactedColumns = 0;
$foundImpactedLines = 0;
foreach ($uniques as $k=>$columns)
{
if ($update)
@@ -2553,7 +2553,7 @@ class dblayeroo
// One column to set is a unique column : check if the where clause
// is filtering more than one entry. If there is more than one
// entry, generate an exception
$this->debugLog ("CLONE because of update");
$this->debugLog ("CLONE because of checking update unique fields");
$objTmp = clone $this;
$objTmp->debugDepth++;
$objTmp->clearRequest ();
@@ -2570,9 +2570,9 @@ class dblayeroo
"Can't update multiple rows with unique value on col '%s'"),
$col));
elseif (count ($resUpdate) === 1)
$foundImpactedColumns++;
$foundImpactedLines++;
}
if ($foundImpactedColumns === 0)
if ($foundImpactedLines === 0)
{
// There is no row available with the WHERE clause provided
// Skip all the UNIQUE tests as there will not have any modification