Created
April 21, 2009 11:57
-
-
Save metaskills/99099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
should 'not add locking conditions to sub selects' do | |
start_sql = "SELECT * FROM [people] WHERE ([people].[id] = 1) AND (id IN (SELECT id FROM CONTAINSTABLE(people,*,'test')))" | |
expected_sql = "SELECT * FROM [people] WITH (NOLOCK) WHERE ([people].[id] = 1) AND (id IN (SELECT id FROM CONTAINSTABLE(people,*,'test')))" | |
assert_equal expected_sql, Person.connection.send(:add_lock!,start_sql,{:lock => 'WITH (NOLOCK)'}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment