Skip to content

Commit

Permalink
Merge pull request doctrine#1 from asgrim/ibmi
Browse files Browse the repository at this point in the history
Change order of parameters in doModifyLimitQuery to work with Migrations
  • Loading branch information
cassvail committed Dec 12, 2015
2 parents 6002abe + c3d9f00 commit c750d2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null)
$offset = (int) (($offset)?:0);

// Todo OVER() needs ORDER BY data!
$sql = 'SELECT db22.* FROM (SELECT ROW_NUMBER() OVER() AS DC_ROWNUM, db21.* '.
$sql = 'SELECT db22.* FROM (SELECT db21.*, ROW_NUMBER() OVER() AS DC_ROWNUM '.
'FROM (' . $query . ') db21) db22 WHERE db22.DC_ROWNUM BETWEEN ' . ($offset+1) .' AND ' . ($offset+$limit);

return $sql;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/DB2iSeriesPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected function doModifyLimitQuery($query, $limit, $offset = null)
$over = 'ORDER BY ' . implode(', ', $overColumns);
}

$sql = 'SELECT DOCTRINE_TBL.* FROM (SELECT ROW_NUMBER() OVER('.$over.') AS DOCTRINE_ROWNUM, DOCTRINE_TBL1.* '.
$sql = 'SELECT DOCTRINE_TBL.* FROM (SELECT DOCTRINE_TBL1.*, ROW_NUMBER() OVER(' . $over . ') AS DOCTRINE_ROWNUM '.
'FROM (' . $query . ') DOCTRINE_TBL1) DOCTRINE_TBL WHERE DOCTRINE_TBL.DOCTRINE_ROWNUM BETWEEN ' . ($offset+1) .' AND ' . ($offset+$limit);

return $sql;
Expand Down

0 comments on commit c750d2d

Please sign in to comment.