diff options
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/visitors/oracle_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/arel/visitors/oracle_spec.rb b/spec/arel/visitors/oracle_spec.rb index 87a1c378ac..07ac352893 100644 --- a/spec/arel/visitors/oracle_spec.rb +++ b/spec/arel/visitors/oracle_spec.rb @@ -25,6 +25,21 @@ module Arel SELECT * FROM (SELECT ORDER BY foo) WHERE ROWNUM <= 10 } end + + it 'creates a different subquery when there is an offset' do + stmt = Nodes::SelectStatement.new + stmt.limit = 10 + stmt.offset = Nodes::Offset.new(10) + sql = @visitor.accept stmt + sql.should be_like %{ + SELECT * FROM ( + SELECT raw_sql_.*, rownum raw_rnum_ + FROM (SELECT ) raw_sql_ + WHERE rownum <= 20 + ) + WHERE raw_rnum_ > 10 + } + end end end end |