activerecord-sqlserver-adapter 8.0.12 → 8.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/active_record/connection_adapters/sqlserver/utils.rb +3 -1
- data/test/cases/utils_test_sqlserver.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 625738c2db15f8173fe68c02c02302c268cfc3f734a21621f1be3fc32bb81a5f
|
|
4
|
+
data.tar.gz: 23c438f98340810bede43dd2b0b948d6d95f2457b5746b179f5f075b4a2c80f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cf5214c05eb096dafaef1eb31da92d220fc2f5a07d627a1f7c32e7b9f40b444147d779ea797c893b668e43588ae753cb759997075eca50fcd5001b6b3942842
|
|
7
|
+
data.tar.gz: 83e61d35aaaaac6553da311471946f0ab1e1412a5452b9b44dbfbe379e1068cea2f551ade7696f3470f45bec0a41707351206f2afd0cc11c02492f409bd80616
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
8.0.
|
|
1
|
+
8.0.13
|
|
@@ -12,6 +12,8 @@ module ActiveRecord
|
|
|
12
12
|
UNQUOTED_SCANNER = /\]?\./
|
|
13
13
|
QUOTED_SCANNER = /\A\[.*?\]\./
|
|
14
14
|
QUOTED_CHECKER = /\A\[/
|
|
15
|
+
QUOTED_IDENTIFIER = /\[(?:[^\]]|\]\])*\]/
|
|
16
|
+
QUOTED_IDENTIFIERS = /\A#{QUOTED_IDENTIFIER}(?:\.+#{QUOTED_IDENTIFIER})*\z/
|
|
15
17
|
|
|
16
18
|
attr_reader :server, :database, :schema, :object
|
|
17
19
|
attr_reader :raw_name
|
|
@@ -113,7 +115,7 @@ module ActiveRecord
|
|
|
113
115
|
end
|
|
114
116
|
|
|
115
117
|
def quote(part)
|
|
116
|
-
part
|
|
118
|
+
QUOTED_IDENTIFIERS.match?(part) ? part : "[#{part.to_s.gsub("]", "]]")}]"
|
|
117
119
|
end
|
|
118
120
|
|
|
119
121
|
def unquote(part)
|
|
@@ -13,6 +13,8 @@ class UtilsTestSQLServer < ActiveRecord::TestCase
|
|
|
13
13
|
|
|
14
14
|
it ".quoted_raw" do
|
|
15
15
|
_(SQLServer::Utils.quoted_raw("some.Name")).must_equal "[some.Name]"
|
|
16
|
+
_(SQLServer::Utils.quoted_raw("[a].[b]")).must_equal "[a].[b]"
|
|
17
|
+
_(SQLServer::Utils.quoted_raw("[a]; DROP TABLE x; --]")).must_equal "[[a]]; DROP TABLE x; --]]]"
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
describe ".extract_identifiers constructor and thus SQLServer::Utils::Name value object" do
|
|
@@ -92,6 +94,12 @@ class UtilsTestSQLServer < ActiveRecord::TestCase
|
|
|
92
94
|
_(extract_identifiers("[obj.name].[foo]").quoted).must_equal "[obj.name].[foo]"
|
|
93
95
|
end
|
|
94
96
|
|
|
97
|
+
it "escapes closing brackets inside identifiers that look already quoted" do
|
|
98
|
+
name = "[[id]; INSERT INTO table (id, value) VALUES (1, 'test'); -- ]]"
|
|
99
|
+
_(extract_identifiers(name).quoted).must_equal "[[id]]; INSERT INTO table (id, value) VALUES (1, 'test'); -- ]]]"
|
|
100
|
+
_(extract_identifiers("[a].[b]").quoted).must_equal "[a].[b]"
|
|
101
|
+
end
|
|
102
|
+
|
|
95
103
|
it "should indicate if a name is fully qualified" do
|
|
96
104
|
_(extract_identifiers("object").fully_qualified?).must_equal false
|
|
97
105
|
_(extract_identifiers("schema.object").fully_qualified?).must_equal false
|
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: 8.0.
|
|
4
|
+
version: 8.0.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ken Collins
|
|
@@ -243,8 +243,8 @@ licenses:
|
|
|
243
243
|
- MIT
|
|
244
244
|
metadata:
|
|
245
245
|
bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
|
|
246
|
-
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v8.0.
|
|
247
|
-
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v8.0.
|
|
246
|
+
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v8.0.13/CHANGELOG.md
|
|
247
|
+
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v8.0.13
|
|
248
248
|
rdoc_options: []
|
|
249
249
|
require_paths:
|
|
250
250
|
- lib
|