Adding fix for #2869, fixes count function not escaping "count" properly in pgsql

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5384 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-07-06 17:19:59 +00:00
parent 558c6eb00a
commit cedf6993b2

View file

@ -1448,7 +1448,7 @@ class Model extends Overloadable {
function findCount($conditions = null, $recursive = 0) {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
list($data) = $this->findAll($conditions, 'COUNT(*) AS ' . $db->value('count'), false, null, 1, $recursive);
list($data) = $this->findAll($conditions, 'COUNT(*) AS ' . $db->name('count'), false, null, 1, $recursive);
if (isset($data[0]['count'])) {
return $data[0]['count'];