diff options
-rw-r--r-- | lib/arel/visitors/oracle.rb | 2 | ||||
-rw-r--r-- | test/visitors/test_oracle.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index 1441a20dbc..6a58a3cff2 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -26,7 +26,7 @@ module Arel SELECT raw_sql_.*, rownum raw_rnum_ FROM (#{sql}) raw_sql_ ) - WHERE raw_rnum_ between #{offset.expr.to_i + 1 } and #{offset.expr.to_i + limit} + WHERE raw_rnum_ >= #{offset.expr.to_i + 1 } and rownum <= #{limit} eosql end diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb index af81f2058b..42bfaadf8a 100644 --- a/test/visitors/test_oracle.rb +++ b/test/visitors/test_oracle.rb @@ -103,7 +103,7 @@ module Arel SELECT raw_sql_.*, rownum raw_rnum_ FROM (SELECT) raw_sql_ ) - WHERE raw_rnum_ between 11 and 20 + WHERE raw_rnum_ >= 11 and rownum <= 10 } end |