activerecord-sqlserver-adapter 4.2.3 → 4.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/activerecord-sqlserver-adapter.gemspec +2 -1
- data/lib/active_record/connection_adapters/sqlserver/database_statements.rb +2 -2
- data/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +1 -1
- data/lib/active_record/connection_adapters/sqlserver/version.rb +1 -1
- data/test/cases/column_test_sqlserver.rb +0 -8
- data/test/cases/specific_schema_test_sqlserver.rb +7 -1
- data/test/models/sqlserver/dot_table_name.rb +3 -0
- data/test/schema/sqlserver_specific_schema.rb +4 -0
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66376e3352f343f00ed459b35bd3ea825209cd66
|
4
|
+
data.tar.gz: 4b8ee4f3981be083fc8e6be1733e182bef5b3b83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35ce29a0a1666f992f6335d0d106a4317abca6891dc758f00a838292db8ddc82e318e0dbe16f6852c1c25a82bdacb44e0bf99598b321c0b4cf86664e49d6b465
|
7
|
+
data.tar.gz: 2d7490d9c29f9cc571e35daab9b5daee3fa6ba910a287b84c5dff9c906f8f9bfb595a730aa90bba4600db63ae8f553ee9df68cba4e56af8a59072b09e750ec69
|
data/CHANGELOG.md
CHANGED
@@ -15,8 +15,9 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
|
-
spec.add_dependency 'activerecord', '~> 4.2.
|
18
|
+
spec.add_dependency 'activerecord', '~> 4.2.1'
|
19
19
|
spec.add_development_dependency 'bundler'
|
20
|
+
spec.add_development_dependency 'guard'
|
20
21
|
spec.add_development_dependency 'guard-minitest'
|
21
22
|
spec.add_development_dependency 'minitest', '< 5.3.4' # PENDING: [Rails5.x] Remove test order constraint.
|
22
23
|
spec.add_development_dependency 'minitest-focus'
|
@@ -65,7 +65,7 @@ module ActiveRecord
|
|
65
65
|
do_execute 'COMMIT TRANSACTION'
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
68
|
+
def exec_rollback_db_transaction
|
69
69
|
do_execute 'IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION'
|
70
70
|
end
|
71
71
|
|
@@ -75,7 +75,7 @@ module ActiveRecord
|
|
75
75
|
do_execute "SAVE TRANSACTION #{name}"
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
78
|
+
def exec_rollback_to_savepoint(name = current_savepoint_name)
|
79
79
|
do_execute "ROLLBACK TRANSACTION #{name}"
|
80
80
|
end
|
81
81
|
|
@@ -235,7 +235,7 @@ module ActiveRecord
|
|
235
235
|
columns.DATETIME_PRECISION AS datetime_precision,
|
236
236
|
columns.ordinal_position,
|
237
237
|
CASE
|
238
|
-
WHEN columns.DATA_TYPE IN ('nchar','nvarchar') THEN columns.CHARACTER_MAXIMUM_LENGTH
|
238
|
+
WHEN columns.DATA_TYPE IN ('nchar','nvarchar','char','varchar') THEN columns.CHARACTER_MAXIMUM_LENGTH
|
239
239
|
ELSE COL_LENGTH('#{database}'+columns.TABLE_SCHEMA+'.'+columns.TABLE_NAME, columns.COLUMN_NAME)
|
240
240
|
END AS [length],
|
241
241
|
CASE
|
@@ -46,9 +46,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
|
|
46
46
|
type.must_be :number?
|
47
47
|
type.limit.must_equal 8
|
48
48
|
assert_obj_set_and_save :bigint, -9_223_372_036_854_775_808
|
49
|
-
assert_raises(RangeError) { new_obj.bigint = -9_223_372_036_854_775_809 }
|
50
49
|
assert_obj_set_and_save :bigint, 9_223_372_036_854_775_807
|
51
|
-
assert_raises(RangeError) { new_obj.bigint = 9_223_372_036_854_775_808 }
|
52
50
|
end
|
53
51
|
|
54
52
|
it 'int(4)' do
|
@@ -64,9 +62,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
|
|
64
62
|
type.must_be :number?
|
65
63
|
type.limit.must_equal 4
|
66
64
|
assert_obj_set_and_save :int, -2_147_483_648
|
67
|
-
assert_raises(RangeError) { new_obj.int = -2_147_483_649 }
|
68
65
|
assert_obj_set_and_save :int, 2_147_483_647
|
69
|
-
assert_raises(RangeError) { new_obj.int = 2_147_483_648 }
|
70
66
|
end
|
71
67
|
|
72
68
|
it 'smallint(2)' do
|
@@ -82,9 +78,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
|
|
82
78
|
type.must_be :number?
|
83
79
|
type.limit.must_equal 2
|
84
80
|
assert_obj_set_and_save :smallint, -32_768
|
85
|
-
assert_raises(RangeError) { new_obj.smallint = -32_769 }
|
86
81
|
assert_obj_set_and_save :smallint, 32_767
|
87
|
-
assert_raises(RangeError) { new_obj.smallint = 32_768 }
|
88
82
|
end
|
89
83
|
|
90
84
|
it 'tinyint(1)' do
|
@@ -100,9 +94,7 @@ class ColumnTestSQLServer < ActiveRecord::TestCase
|
|
100
94
|
type.must_be :number?
|
101
95
|
type.limit.must_equal 1
|
102
96
|
assert_obj_set_and_save :tinyint, 0
|
103
|
-
assert_raises(RangeError) { new_obj.tinyint = -1 }
|
104
97
|
assert_obj_set_and_save :tinyint, 255
|
105
|
-
assert_raises(RangeError) { new_obj.tinyint = 256 }
|
106
98
|
end
|
107
99
|
|
108
100
|
it 'bit' do
|
@@ -5,10 +5,16 @@ class SpecificSchemaTestSQLServer < ActiveRecord::TestCase
|
|
5
5
|
after { SSTestEdgeSchema.delete_all }
|
6
6
|
|
7
7
|
it 'handle dollar symbols' do
|
8
|
-
SSTestDollarTableName.
|
8
|
+
SSTestDollarTableName.create!
|
9
9
|
SSTestDollarTableName.limit(20).offset(1)
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'handle dot table names' do
|
13
|
+
SSTestDotTableName.create! name: 'test'
|
14
|
+
SSTestDotTableName.limit(20).offset(1)
|
15
|
+
SSTestDotTableName.where(name: 'test').first.must_be :present?
|
16
|
+
end
|
17
|
+
|
12
18
|
it 'models can use tinyint pk tables' do
|
13
19
|
obj = SSTestTinyintPk.create! name: '1'
|
14
20
|
obj.id.is_a? Fixnum
|
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.
|
4
|
+
version: 4.2.4
|
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: 2015-
|
17
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
@@ -22,14 +22,14 @@ dependencies:
|
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 4.2.
|
25
|
+
version: 4.2.1
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.2.
|
32
|
+
version: 4.2.1
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: guard
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: guard-minitest
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,6 +273,7 @@ files:
|
|
259
273
|
- test/models/sqlserver/datatype.rb
|
260
274
|
- test/models/sqlserver/datatype_migration.rb
|
261
275
|
- test/models/sqlserver/dollar_table_name.rb
|
276
|
+
- test/models/sqlserver/dot_table_name.rb
|
262
277
|
- test/models/sqlserver/edge_schema.rb
|
263
278
|
- test/models/sqlserver/fk_has_fk.rb
|
264
279
|
- test/models/sqlserver/fk_has_pk.rb
|
@@ -333,6 +348,7 @@ test_files:
|
|
333
348
|
- test/models/sqlserver/datatype.rb
|
334
349
|
- test/models/sqlserver/datatype_migration.rb
|
335
350
|
- test/models/sqlserver/dollar_table_name.rb
|
351
|
+
- test/models/sqlserver/dot_table_name.rb
|
336
352
|
- test/models/sqlserver/edge_schema.rb
|
337
353
|
- test/models/sqlserver/fk_has_fk.rb
|
338
354
|
- test/models/sqlserver/fk_has_pk.rb
|