Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix missing check for COUNT(DISTINCT in DboMSSQL

Fixes #2470
  • Loading branch information...
commit f867f0c97fff319aae63a8a96a39d1f28c47c5e7 1 parent 340a9fd
Mark Story markstory authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 cake/libs/model/datasources/dbo/dbo_mssql.php
6 cake/libs/model/datasources/dbo/dbo_mssql.php
View
@@ -325,7 +325,11 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
$fields = parent::fields($model, $alias, $fields, false);
$count = count($fields);
- if ($count >= 1 && strpos($fields[0], 'COUNT(*)') === false) {
+ if (
+ $count >= 1 &&
+ strpos($fields[0], 'COUNT(*)') === false &&
+ strpos($fields[0], 'COUNT(DISTINCT') === false
+ ) {
$result = array();
for ($i = 0; $i < $count; $i++) {
$prepend = '';
Please sign in to comment.
Something went wrong with that request. Please try again.