working RowNum.pm
Matt S Trout [Fri, 17 Aug 2012 12:40:01 +0000 (13:40 +0100)]
lib/Data/Query/Renderer/SQL/Slice/RowNum.pm

index c14790a..7b90fcf 100644 (file)
@@ -45,7 +45,7 @@ sub _render_slice {
         Where(
           Operator(
             { 'SQL.Naive' => '>=' },
-            [ Identifier($rownum_name), $limit_plus_offset, ]
+            [ Identifier($rownum_name), $offset_plus ]
           ),
           Alias(
             $remapped{default_inside_alias},
@@ -55,7 +55,7 @@ sub _render_slice {
               Where(
                 Operator(
                   { 'SQL.Naive' => '<=' },
-                  [ Literal(SQL => 'ROWNUM'), $offset_plus ]
+                  [ Literal(SQL => 'ROWNUM'), $limit_plus_offset ]
                 ),
                 $inside_select,
               )
@@ -71,7 +71,7 @@ sub _render_slice {
         Where(
           Operator(
             { 'SQL.Naive' => 'BETWEEN' },
-            [ Identifier($rownum_name), $limit_plus_offset, $offset_plus ]
+            [ Identifier($rownum_name), $offset_plus, $limit_plus_offset ]
           ),
           Alias(
             $remapped{default_inside_alias},