activerecord-sqlserver-adapter 2.3.22 → 2.3.23
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
|
+
* 2.3.23 *
|
3
|
+
|
4
|
+
* Create a #configure_connection method that can be overridden. Think "SET TEXTSIZE...".
|
5
|
+
|
6
|
+
* Fixed the #finish_statement_handle to cancel the TinyTDS connection if needed.
|
7
|
+
|
8
|
+
* Fix the #indexes method to fail gracefully if sp_helptext permissions fail.
|
9
|
+
|
10
|
+
|
2
11
|
* 2.3.22 *
|
3
12
|
|
4
13
|
* Make #rollback_db_transaction smarter.
|
@@ -147,7 +147,7 @@ module ActiveRecord
|
|
147
147
|
class SQLServerAdapter < AbstractAdapter
|
148
148
|
|
149
149
|
ADAPTER_NAME = 'SQLServer'.freeze
|
150
|
-
VERSION = '2.3.
|
150
|
+
VERSION = '2.3.23'.freeze
|
151
151
|
DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+(\d{4})/
|
152
152
|
SUPPORTED_VERSIONS = [2000,2005,2008].freeze
|
153
153
|
LIMITABLE_TYPES = ['string','integer','float','char','nchar','varchar','nvarchar'].to_set.freeze
|
@@ -612,7 +612,8 @@ module ActiveRecord
|
|
612
612
|
|
613
613
|
def indexes(table_name, name = nil)
|
614
614
|
unquoted_table_name = unqualify_table_name(table_name)
|
615
|
-
select("EXEC sp_helpindex #{quote_table_name(unquoted_table_name)}",name)
|
615
|
+
data = select("EXEC sp_helpindex #{quote_table_name(unquoted_table_name)}",name) rescue []
|
616
|
+
data.inject([]) do |indexes,index|
|
616
617
|
index = index.with_indifferent_access
|
617
618
|
if index[:index_description] =~ /primary key/
|
618
619
|
indexes
|
@@ -867,10 +868,18 @@ module ActiveRecord
|
|
867
868
|
connection.open
|
868
869
|
end
|
869
870
|
end
|
871
|
+
configure_connection
|
870
872
|
rescue
|
871
873
|
raise unless @auto_connecting
|
872
874
|
end
|
873
875
|
|
876
|
+
# Override this method so every connection can be configured to your needs.
|
877
|
+
# For example:
|
878
|
+
# do_execute "SET TEXTSIZE #{64.megabytes}"
|
879
|
+
# do_execute "SET CONCAT_NULL_YIELDS_NULL ON"
|
880
|
+
def configure_connection
|
881
|
+
end
|
882
|
+
|
874
883
|
def lost_connection_exceptions
|
875
884
|
exceptions = LOST_CONNECTION_EXCEPTIONS[@connection_options[:mode]]
|
876
885
|
@lost_connection_exceptions ||= exceptions ? exceptions.map(&:constantize) : []
|
@@ -934,6 +943,7 @@ module ActiveRecord
|
|
934
943
|
def finish_statement_handle(handle)
|
935
944
|
case @connection_options[:mode]
|
936
945
|
when :dblib
|
946
|
+
handle.cancel if handle
|
937
947
|
when :odbc
|
938
948
|
handle.drop if handle && handle.respond_to?(:drop) && !handle.finished?
|
939
949
|
when :adonet
|
@@ -23,6 +23,7 @@ require 'active_record/version'
|
|
23
23
|
GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly?)
|
24
24
|
|
25
25
|
ActiveRecord::Migration.verbose = false
|
26
|
+
ActiveRecord::ConnectionAdapters::SQLServerAdapter.log_info_schema_queries = true
|
26
27
|
|
27
28
|
# Defining our classes in one place as well as soem core tests that need coercing date/time types.
|
28
29
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-sqlserver-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 23
|
10
|
+
version: 2.3.23
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ken Collins
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2011-10-
|
22
|
+
date: 2011-10-23 00:00:00 -04:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|