Merge pull request #11616 from cakephp/issue-11186

Fix missing field identifier quoting for COUNT(DISTINCT in SQLServer.
This commit is contained in:
Mark Sch 2018-02-05 14:48:22 +01:00 committed by GitHub
commit df9c7fd96e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -383,6 +383,10 @@ class SqlserverTest extends CakeTestCase {
$result = $this->db->fields($this->model, null, 'DISTINCT Car.country_code');
$expected = array('DISTINCT [Car].[country_code] AS [Car__country_code]');
$this->assertEquals($expected, $result);
$result = $this->db->fields($this->model, null, 'COUNT(DISTINCT Car.country_code)');
$expected = array('COUNT(DISTINCT [Car].[country_code]) AS [Car__country_code]');
$this->assertEquals($expected, $result);
}
/**