Browse files

Merge pull request #174 from eduardordm/master

Revert fixes involving issue #99 (which makes Arel unusable in large datasets)
  • Loading branch information...
2 parents 026695a + 47d5302 commit 933ea218116645eafaf3b7ea5695520db0f9d9ba @rafaelfranca rafaelfranca committed Mar 15, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/arel/visitors/oracle.rb
  2. +2 −1 test/visitors/test_oracle.rb
View
3 lib/arel/visitors/oracle.rb
@@ -25,8 +25,9 @@ def visit_Arel_Nodes_SelectStatement o
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
FROM (#{sql}) raw_sql_
+ WHERE rownum <= #{offset.expr.to_i + limit}
)
- WHERE raw_rnum_ >= #{offset.expr.to_i + 1 } and rownum <= #{limit}
+ WHERE #{visit offset}
eosql
end
View
3 test/visitors/test_oracle.rb
@@ -102,8 +102,9 @@ module Visitors
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
FROM (SELECT) raw_sql_
+ WHERE rownum <= 20
)
- WHERE raw_rnum_ >= 11 and rownum <= 10
+ WHERE raw_rnum_ > 10
}
end

0 comments on commit 933ea21

Please sign in to comment.