diff options
author | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2010-10-21 11:22:48 +0300 |
---|---|---|
committer | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2010-10-21 11:22:48 +0300 |
commit | ec6ac6654ed7eb678bb0b8f58fe3e7d9b932e297 (patch) | |
tree | 93774c0a73e521476d0ecab1de9e09d7d7606a8e /test/visitors | |
parent | c66f025a8ebfd1d75ac6c5082df5cb4176f3a7bf (diff) | |
download | rails-ec6ac6654ed7eb678bb0b8f58fe3e7d9b932e297.tar.gz rails-ec6ac6654ed7eb678bb0b8f58fe3e7d9b932e297.tar.bz2 rails-ec6ac6654ed7eb678bb0b8f58fe3e7d9b932e297.zip |
generate correct select if only offset is present (in Oracle)
Diffstat (limited to 'test/visitors')
-rw-r--r-- | test/visitors/test_oracle.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb index db277088f1..d2a73ea8c5 100644 --- a/test/visitors/test_oracle.rb +++ b/test/visitors/test_oracle.rb @@ -105,6 +105,22 @@ module Arel sql.must_equal sql2 end end + + describe 'only offset' do + it 'creates a select from subquery with rownum condition' do + stmt = Nodes::SelectStatement.new + stmt.offset = Nodes::Offset.new(10) + sql = @visitor.accept stmt + sql.must_be_like %{ + SELECT * FROM ( + SELECT raw_sql_.*, rownum raw_rnum_ + FROM (SELECT ) raw_sql_ + ) + WHERE raw_rnum_ > 10 + } + end + end + end end end |