Skip to content

Commit 3fd6d7b

Browse files
committed
Set product_level, product_version, and edition where we get information about the database as opposed to the connection itself.
1 parent b1c4836 commit 3fd6d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def initialize(logger,config)
208208
rescue
209209
0
210210
end
211+
@product_level = info_schema_query { select_value("SELECT CAST(SERVERPROPERTY('productlevel') AS VARCHAR(128))") }
212+
@product_version = info_schema_query { select_value("SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(128))") }
213+
@edition = info_schema_query { select_value("SELECT CAST(SERVERPROPERTY('edition') AS VARCHAR(128))") }
211214
initialize_dateformatter
212215
initialize_sqlserver_caches
213216
use_database
@@ -432,9 +435,6 @@ def connect
432435
end
433436
end
434437
@spid = _raw_select("SELECT @@SPID", :fetch => :rows).first.first
435-
@product_level = _raw_select("SELECT CAST(SERVERPROPERTY('productlevel') AS VARCHAR(128))", :fetch => :rows).first.first
436-
@product_version = _raw_select("SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(128))", :fetch => :rows).first.first
437-
@edition = _raw_select("SELECT CAST(SERVERPROPERTY('edition') AS VARCHAR(128))", :fetch => :rows).first.first
438438
configure_connection
439439
rescue
440440
raise unless @auto_connecting

0 commit comments

Comments
 (0)