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:
parent
219a2c2064
commit
f94d3e4703
@ -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;
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user