1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Fixed OFFSET clause generation of Pgsql driver, which added the OFFSET keyword without a value to the SQL query in case of OFFSET 0. fixes #230

This commit is contained in:
Tanken 2006-11-13 08:01:56 +00:00
parent 219a2c2064
commit f94d3e4703
2 changed files with 7 additions and 2 deletions

View File

@ -128,7 +128,12 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
. $from . ' ' . $where . ' LIMIT ' . $limit . ')';
} else {
$query .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
if($limit !== false) {
$query .= ' LIMIT ' . $limit;
}
if($offset !== false) {
$query .= ' OFFSET ' . $offset;
}
}
}
return $query;

View File

@ -369,7 +369,7 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
break;
case 'limit':
case 'offset':
if($args[0] === null)
if($args[0] == null)
$args[0] = false;
$this->parts[$name] = $args[0];