Skip to content

Commit 4095950

Browse files
committed
Update sub select test a bit for visual clues as to what is going on.
1 parent 1914baa commit 4095950

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/cases/offset_and_limit_test_sqlserver.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def setup
7878

7979
should 'not create invalid SQL with subquery SELECTs with TOP' do
8080
options = { :limit => 5, :offset => 1 }
81-
assert_nothing_raised(ActiveRecord::StatementInvalid) { @connection.add_limit_offset!(@subquery_select_sql, options) }
81+
expected_sql = "SELECT * FROM (SELECT TOP 5 * FROM (SELECT TOP 6 *, (SELECT TOP 1 id FROM books) AS book_id FROM books) AS tmp1) AS tmp2"
82+
assert_equal expected_sql, @connection.add_limit_offset!(@subquery_select_sql,options)
8283
end
84+
8385
end
8486

8587

0 commit comments

Comments
 (0)