activerecord-sqlserver-adapter 4.2.11 → 4.2.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5645093f45bc28adecc3cc3a38fdb886f6683a9c
4
- data.tar.gz: bddd84dff29484133c22f905f3c75439a68cbbe5
3
+ metadata.gz: 54c5914ff2792205172ac4e9f99f9f43cef3476c
4
+ data.tar.gz: 126e1fc2846d80fef6c1818ead2c3f4c125cfe3e
5
5
  SHA512:
6
- metadata.gz: e2e9df466a158a7a1d35860e6c32c75b4e9f46774122b7cfcf8f43c1d9f770cb1a723cedf92f30ec9d06ec39501be10a018bbd0f6ffcff1257160127de7fa3f3
7
- data.tar.gz: d24d8c79658031f51266734f5648af3cf5dc3e47911a245774f2a9dd32aecfbb25407703758ef707140507af7ab632dac93ccf193f9c30dd3c74543b5b6ef025
6
+ metadata.gz: 6dada71646dfbad6c3664eadbc4d8d29d09575b20833c1d7809d506d26e91dde269dacc3cafd21748c9683b30a1bdd1e8e72fa6880480c2f7101fa19f9d64cab
7
+ data.tar.gz: 2a7764404a937e063993ebfe641949841b06cc9d2bbebf69c8deb61c8c7427ec1527a7fa2a171a28d91316abf62626539112e67b7230c83f99b8678f4100a83f
@@ -1,3 +1,10 @@
1
+ ## v4.2.12
2
+
3
+ #### Fixed
4
+
5
+ * Isolation levels not being reset on error. Fixes #469. Thanks @anthony
6
+
7
+
1
8
  ## v4.2.11
2
9
 
3
10
  #### Fixed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.11
1
+ 4.2.12
@@ -2,7 +2,7 @@ init:
2
2
  - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
3
3
  - SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
4
4
  - SET RAKEOPT=-rdevkit
5
- - SET TINYTDS_VERSION=0.9.5.rc.3
5
+ - SET TINYTDS_VERSION=1.0.2
6
6
  clone_depth: 5
7
7
  skip_tags: true
8
8
  matrix:
@@ -20,17 +20,13 @@ test_script:
20
20
  - timeout /t 4 /nobreak > NUL
21
21
  - sqlcmd -S ".\SQL2014" -U sa -P Password12! -i %APPVEYOR_BUILD_FOLDER%\test\appveyor\dbsetup.sql
22
22
  - bundle exec rake test ACTIVERECORD_UNITTEST_DATASERVER="localhost\SQL2014"
23
- - bundle exec rake test ACTIVERECORD_UNITTEST_DATASERVER="localhost\SQL2014" ACTIVERECORD_UNITTEST_TDSVERSION="7.3"
24
23
  - ps: Stop-Service 'MSSQL$SQL2014'
25
24
  - ps: Start-Service 'MSSQL$SQL2012SP1'
26
25
  - timeout /t 4 /nobreak > NUL
27
26
  - sqlcmd -S ".\SQL2012SP1" -U sa -P Password12! -i %APPVEYOR_BUILD_FOLDER%\test\appveyor\dbsetup.sql
28
27
  - bundle exec rake test ACTIVERECORD_UNITTEST_DATASERVER="localhost\SQL2012SP1"
29
- - bundle exec rake test ACTIVERECORD_UNITTEST_DATASERVER="localhost\SQL2012SP1" ACTIVERECORD_UNITTEST_TDSVERSION="7.3"
30
- # - timeout /t 4 /nobreak > NUL
31
- # - bundle exec rake test ACTIVERECORD_UNITTEST_HOST=%CI_AZURE_HOST% ACTIVERECORD_UNITTEST_PASS=%CI_AZURE_PASS% ACTIVERECORD_UNITTEST_AZURE=1
32
- # - timeout /t 4 /nobreak > NUL
33
- # - bundle exec rake test ACTIVERECORD_UNITTEST_HOST=%CI_AZURE_HOST% ACTIVERECORD_UNITTEST_PASS=%CI_AZURE_PASS% ACTIVERECORD_UNITTEST_AZURE=1 TDSVER=7.3
28
+ - timeout /t 4 /nobreak > NUL
29
+ - bundle exec rake test ACTIVERECORD_UNITTEST_HOST=%CI_AZURE_HOST% ACTIVERECORD_UNITTEST_PASS=%CI_AZURE_PASS% ACTIVERECORD_UNITTEST_AZURE=1
34
30
  environment:
35
31
  CI_AZURE_HOST:
36
32
  secure: VChrioaIWkf9iuuaSs4cryiA4honrADgZqNC0++begg=
@@ -58,7 +58,6 @@ module ActiveRecord
58
58
 
59
59
  def set_transaction_isolation_level(isolation_level)
60
60
  do_execute "SET TRANSACTION ISOLATION LEVEL #{isolation_level}"
61
- begin_db_transaction
62
61
  end
63
62
 
64
63
  def commit_db_transaction
@@ -36,6 +36,11 @@ module ActiveRecord
36
36
  reset_starting_isolation_level
37
37
  end
38
38
 
39
+ def rollback
40
+ super
41
+ reset_starting_isolation_level
42
+ end
43
+
39
44
  private
40
45
 
41
46
  def reset_starting_isolation_level
@@ -61,6 +61,7 @@ module ActiveRecord
61
61
  command.concat(table_args)
62
62
  view_args = connection.views.map { |v| Shellwords.escape(v) }
63
63
  command.concat(view_args)
64
+ puts command.inspect
64
65
  raise 'Error dumping database' unless Kernel.system(command.join(' '))
65
66
  dump = File.read(filename)
66
67
  dump.gsub!(/^USE .*$\nGO\n/, '') # Strip db USE statements
@@ -43,7 +43,7 @@ class SQLServerRakeCreateTest < SQLServerRakeTest
43
43
 
44
44
  it 'establishes connection to database after create ' do
45
45
  db_tasks.create configuration
46
- connection.current_database.must_equal(new_database)
46
+ connection.current_database.must_equal(connection_sqlserver_azure? ? 'master' : new_database)
47
47
  end
48
48
 
49
49
  it 'creates database with default collation' do
@@ -32,20 +32,24 @@ class TransactionTestSQLServer < ActiveRecord::TestCase
32
32
  end
33
33
 
34
34
  it 'can use an isolation level and reverts back to starting isolation level' do
35
- begin
36
- in_level = nil
37
- begin_level = connection.user_options_isolation_level
38
- begin_level.must_match %r{read committed}i
39
- Ship.transaction(isolation: :serializable) do
40
- Ship.create! name: 'Black Pearl'
41
- in_level = connection.user_options_isolation_level
42
- end
43
- after_level = connection.user_options_isolation_level
44
- in_level.must_match %r{serializable}i
45
- after_level.must_match %r{read committed}i
46
- ensure
47
- connection.set_transaction_isolation_level 'READ COMMITTED'
35
+ in_level = nil
36
+ begin_level = connection.user_options_isolation_level
37
+ begin_level.must_match %r{read committed}i
38
+ Ship.transaction(isolation: :serializable) do
39
+ Ship.create! name: 'Black Pearl'
40
+ in_level = connection.user_options_isolation_level
48
41
  end
42
+ after_level = connection.user_options_isolation_level
43
+ in_level.must_match %r{serializable}i
44
+ after_level.must_match %r{read committed}i
45
+ end
46
+
47
+ it 'can use an isolation level and reverts back to starting isolation level under exceptions' do
48
+ connection.user_options_isolation_level.must_match %r{read committed}i
49
+ lambda {
50
+ Ship.transaction(isolation: :serializable) { Ship.create! }
51
+ }.must_raise(ActiveRecord::RecordInvalid)
52
+ connection.user_options_isolation_level.must_match %r{read committed}i
49
53
  end
50
54
 
51
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.11
4
+ version: 4.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2016-04-24 00:00:00.000000000 Z
17
+ date: 2016-05-10 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.4.8
191
+ rubygems_version: 2.6.4
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: ActiveRecord SQL Server Adapter.