mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing error introduced by previous commit
This commit is contained in:
parent
b3f860b762
commit
7668894888
2 changed files with 9 additions and 1 deletions
|
@ -493,7 +493,7 @@ class DboPostgres extends DboSource {
|
|||
$match[1] = trim(str_replace('DISTINCT', '', $match[1]));
|
||||
}
|
||||
if (strpos($match[1], '.') === false) {
|
||||
$match[1] = $this->name($alias . '.' . $match[1]);
|
||||
$match[1] = $this->name($match[1]);
|
||||
} else {
|
||||
$parts = explode('.', $match[1]);
|
||||
if (!Set::numeric($parts)) {
|
||||
|
|
|
@ -795,6 +795,14 @@ class DboPostgresTest extends CakeTestCase {
|
|||
$result = $this->db->fields($Article, null, array('COUNT(DISTINCT Article.id)'));
|
||||
$expected = array('COUNT(DISTINCT "Article"."id")');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->db->fields($Article, null, array('COUNT(DISTINCT id)'));
|
||||
$expected = array('COUNT(DISTINCT "id")');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->db->fields($Article, null, array('COUNT(DISTINCT FUNC(id))'));
|
||||
$expected = array('COUNT(DISTINCT FUNC("id"))');
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue