Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1784 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit c20713834a6f3e14286fb501029437708609eaff 1 parent 165f82d
@dhh dhh authored
View
2  activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
+
* Added ActiveRecord::Migrator.migrate that can figure out whether to go up or down based on the target version and the current
* Added better error message for "packets out of order" #1630 [courtenay]
View
4 activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -236,9 +236,9 @@ def insert(sql, name = nil, pk = nil, id_value = nil)
end
def execute(sql, name = nil)
- if sql =~ /^INSERT/i
+ if sql =~ /^\s*INSERT/i
insert(sql, name)
- elsif sql =~ /^UPDATE|DELETE/i
+ elsif sql =~ /^\s*UPDATE|^\s*DELETE/i
log(sql, name) do
@connection.execute(sql)
retVal = select_one("SELECT @@ROWCOUNT AS AffectedRows")["AffectedRows"]
Please sign in to comment.
Something went wrong with that request. Please try again.