aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@squareup.com>2015-02-23 09:58:22 -0800
committerTamir Duberstein <tamird@squareup.com>2015-02-23 09:58:22 -0800
commitd86e20ccbea226bb6e42da508bc040fd03ab473f (patch)
treeb0fd958a2a7cdb947ffb8ce1e933c531941fea3a /test/visitors
parent65135d00a854edfd1684f5163db8e68fdb956ae0 (diff)
downloadrails-d86e20ccbea226bb6e42da508bc040fd03ab473f.tar.gz
rails-d86e20ccbea226bb6e42da508bc040fd03ab473f.tar.bz2
rails-d86e20ccbea226bb6e42da508bc040fd03ab473f.zip
Special limited delete handling in MSSQL
Refernce: https://technet.microsoft.com/en-us/library/ms175486%28v=sql.105%29.aspx
Diffstat (limited to 'test/visitors')
-rw-r--r--test/visitors/test_mssql.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/visitors/test_mssql.rb b/test/visitors/test_mssql.rb
index 7574aeb0a2..fe228bce4b 100644
--- a/test/visitors/test_mssql.rb
+++ b/test/visitors/test_mssql.rb
@@ -45,6 +45,15 @@ module Arel
connection.verify
end
+ it 'should use TOP for limited deletes' do
+ stmt = Nodes::DeleteStatement.new
+ stmt.relation = @table
+ stmt.limit = Nodes::Limit.new(10)
+ sql = compile(stmt)
+
+ sql.must_be_like "DELETE TOP (10) FROM \"users\""
+ end
+
it 'should go over query ORDER BY if .order()' do
stmt = Nodes::SelectStatement.new
stmt.limit = Nodes::Limit.new(10)