Skip to content

Commit

Permalink
fix DoctrineDBAL bug with offset on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
adou600 committed Apr 13, 2012
1 parent 3efdc59 commit 40df5d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Jackalope/Transport/DoctrineDBAL/Client.php
Expand Up @@ -1488,6 +1488,11 @@ public function query(\PHPCR\Query\QueryInterface $query)
$limit = $query->getLimit();
$offset = $query->getOffset();

//hack to avoid a bug in Doctrine DBAL with MySQL, see http://www.doctrine-project.org/jira/browse/DBAL-256
if ($this->conn->getDatabasePlatform()->getName() === 'mysql' && null !== $offset && null == $limit) {
$limit = PHP_INT_MAX;
}

$language = $query->getLanguage();
if ($language === QueryInterface::JCR_SQL2) {
$parser = new Sql2ToQomQueryConverter($this->factory->get('Query\QOM\QueryObjectModelFactory'));
Expand Down

0 comments on commit 40df5d6

Please sign in to comment.