mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Merge branch '1.3' of github.com:cakephp/cakephp1x into 1.3
This commit is contained in:
commit
4d780ee1f3
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]));
|
$match[1] = trim(str_replace('DISTINCT', '', $match[1]));
|
||||||
}
|
}
|
||||||
if (strpos($match[1], '.') === false) {
|
if (strpos($match[1], '.') === false) {
|
||||||
$match[1] = $this->name($alias . '.' . $match[1]);
|
$match[1] = $this->name($match[1]);
|
||||||
} else {
|
} else {
|
||||||
$parts = explode('.', $match[1]);
|
$parts = explode('.', $match[1]);
|
||||||
if (!Set::numeric($parts)) {
|
if (!Set::numeric($parts)) {
|
||||||
|
|
|
@ -795,6 +795,14 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
$result = $this->db->fields($Article, null, array('COUNT(DISTINCT Article.id)'));
|
$result = $this->db->fields($Article, null, array('COUNT(DISTINCT Article.id)'));
|
||||||
$expected = array('COUNT(DISTINCT "Article"."id")');
|
$expected = array('COUNT(DISTINCT "Article"."id")');
|
||||||
$this->assertEqual($result, $expected);
|
$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