activerecord-sqlserver-adapter 7.2.9 → 7.2.10
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 +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc5ef60e97cb07f48326c92ac2ec3c8e998ab931ce728f17312775d271ce9eff
|
|
4
|
+
data.tar.gz: cb193f4f065da4e1d2b545ac07162452c3e1145b1f4295bcc609d6d9b53227d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c60f01776e222341da6c880387a25017ff72a2ecb66faaaaeadcacfefc02b090c9781c98250d43ef23fa26f51773cd0e7a40b1817ccc132ee15f1de46e2feef6
|
|
7
|
+
data.tar.gz: 0e7c15a85bccba95b78be0eeef6245153207adde9d0d610b9c8940f3d639fc604f6c17f776d4ba0adc9fd81f2c0f75dee7dd4346bbd353984187e3fcb5259eeb
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.2.
|
|
1
|
+
7.2.10
|
|
@@ -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: 7.2.
|
|
4
|
+
version: 7.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ken Collins
|
|
@@ -241,8 +241,8 @@ licenses:
|
|
|
241
241
|
- MIT
|
|
242
242
|
metadata:
|
|
243
243
|
bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
|
|
244
|
-
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.
|
|
245
|
-
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.
|
|
244
|
+
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.10/CHANGELOG.md
|
|
245
|
+
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.10
|
|
246
246
|
rdoc_options: []
|
|
247
247
|
require_paths:
|
|
248
248
|
- lib
|
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
257
257
|
- !ruby/object:Gem::Version
|
|
258
258
|
version: '0'
|
|
259
259
|
requirements: []
|
|
260
|
-
rubygems_version:
|
|
260
|
+
rubygems_version: 4.0.16
|
|
261
261
|
specification_version: 4
|
|
262
262
|
summary: ActiveRecord SQL Server Adapter.
|
|
263
263
|
test_files:
|