mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-09 15:00:07 +01:00
Silence error_log, hopefully fix wrong row count
This commit is contained in:
parent
e1dbe90846
commit
8cfb2c997f
@ -375,8 +375,6 @@ class Sql extends Api\Storage
|
|||||||
$join
|
$join
|
||||||
);
|
);
|
||||||
|
|
||||||
error_log(__METHOD__ . ':'.__LINE__ . ' Subquery: ' . $sub_query);
|
|
||||||
|
|
||||||
$columns = implode(', ', $group);
|
$columns = implode(', ', $group);
|
||||||
if ($this->db->Type == 'mysql' && $this->db->ServerInfo['version'] >= 4.0)
|
if ($this->db->Type == 'mysql' && $this->db->ServerInfo['version'] >= 4.0)
|
||||||
{
|
{
|
||||||
@ -384,19 +382,11 @@ class Sql extends Api\Storage
|
|||||||
}
|
}
|
||||||
|
|
||||||
$rows = $this->db->query(
|
$rows = $this->db->query(
|
||||||
"SELECT " . $columns. ', COUNT(contact_id) AS group_count' .
|
"SELECT $mysql_calc_rows " . $columns. ', COUNT(contact_id) AS group_count' .
|
||||||
' FROM (' . $sub_query . ') AS matches GROUP BY ' . implode(',',$group) .
|
' FROM (' . $sub_query . ') AS matches GROUP BY ' . implode(',',$group) .
|
||||||
' HAVING group_count > 1 ORDER BY ' . $order,
|
' HAVING group_count > 1 ORDER BY ' . $order,
|
||||||
__LINE__, __FILE__, (int)$param['start'],$mysql_calc_rows ? (int)$param['num_rows'] : -1
|
__LINE__, __FILE__, (int)$param['start'],$mysql_calc_rows ? (int)$param['num_rows'] : -1
|
||||||
);
|
);
|
||||||
if ($mysql_calc_rows)
|
|
||||||
{
|
|
||||||
$this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchColumn();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->total = $rows->NumRows();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Go through rows and only return one for each pair/triplet/etc. of matches
|
// Go through rows and only return one for each pair/triplet/etc. of matches
|
||||||
$dupes = array();
|
$dupes = array();
|
||||||
@ -406,6 +396,15 @@ class Sql extends Api\Storage
|
|||||||
$row['email_home'] = $row['contact_email_home'];
|
$row['email_home'] = $row['contact_email_home'];
|
||||||
$dupes[] = $this->db2data($row);
|
$dupes[] = $this->db2data($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($mysql_calc_rows)
|
||||||
|
{
|
||||||
|
$this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchColumn();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->total = $rows->NumRows();
|
||||||
|
}
|
||||||
return $dupes;
|
return $dupes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user