From b603232aeeacf28c2d73d42566b06920ee564ee5 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 17 Jul 2011 17:42:47 -0430 Subject: [PATCH] Removing redundant call to DboSource::fields(), the fields come already quoted from DboSource::read() --- lib/Cake/Model/Datasource/DboSource.php | 2 +- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 15e941ecc..f04ad208b 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -1460,7 +1460,7 @@ class DboSource extends DataSource { $queryData['fields'] = $this->fields($model, $modelAlias); } elseif (!empty($model->hasMany) && $model->recursive > -1) { $assocFields = $this->fields($model, $modelAlias, array("{$modelAlias}.{$model->primaryKey}")); - $passedFields = $this->fields($model, $modelAlias, $queryData['fields']); + $passedFields = $queryData['fields']; if (count($passedFields) === 1) { if (strpos($passedFields[0], $assocFields[0]) === false && !preg_match('/^[a-z]+\(/i', $passedFields[0])) { $queryData['fields'] = array_merge($passedFields, $assocFields); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index e782f888d..cfd70e686 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -1609,7 +1609,7 @@ class DboMysqlTest extends CakeTestCase { $this->_buildRelatedModels($this->Model); $binding = array('type' => 'hasMany', 'model' => 'TestModel6'); - $queryData = array('fields' => array('MIN(TestModel5.test_model4_id)')); + $queryData = array('fields' => array('MIN(`TestModel5`.`test_model4_id`)')); $resultSet = null; $null = null;