another small optimization from last fix

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7281 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-06-27 05:34:37 +00:00
parent 70276afa3b
commit 0fc7355e6b
2 changed files with 5 additions and 3 deletions

View file

@ -500,7 +500,7 @@ class DboMysql extends DboSource {
*/
function index($model) {
$index = array();
$table = $this->fullTableName($model, false);
$table = $this->fullTableName($model);
if($table) {
$indexes = $this->query('SHOW INDEX FROM ' . $table);
$keys = Set::extract($indexes, '{n}.STATISTICS');

View file

@ -870,8 +870,10 @@ class DboSource extends DataSource {
*/
function fetchAssociated($model, $query, $ids) {
$query = str_replace('{$__cakeID__$}', join(', ', $ids), $query);
$query = str_replace('= (', 'IN (', $query);
$query = str_replace('= (', 'IN (', $query);
if (count($ids) > 1) {
$query = str_replace('= (', 'IN (', $query);
$query = str_replace('= (', 'IN (', $query);
}
return $this->fetchAll($query, $model->cacheQueries, $model->alias);
}