odbc_adapter 5.0.1 → 5.0.2
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50537871f7c280cfa024f2757f0b34a24cf74494
|
|
4
|
+
data.tar.gz: ecfa4c272bdeb25fbcdfd82a7999613ff411de4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c82ef5e10b49d630fd7d1c0d9c57b947fd2fd71e9210bbe56c1bbfbc80f175de4e4323b6685ac518f2a0a128c9f9afe028288aba5d9971a4b2b90db913a67c4f
|
|
7
|
+
data.tar.gz: abec63e36b8bf76012eb9d0ac49972865096b7ad4c083a0586017c16e5d7c7c0e5c7ac9cf6cfc12b33133680100dc6cd5df411cfdfe2af3645dfaf4729bdbf02
|
|
@@ -77,8 +77,9 @@ module ActiveRecord
|
|
|
77
77
|
ADAPTER_NAME = 'ODBC'.freeze
|
|
78
78
|
BOOLEAN_TYPE = 'BOOLEAN'.freeze
|
|
79
79
|
|
|
80
|
-
ERR_DUPLICATE_KEY_VALUE
|
|
81
|
-
ERR_QUERY_TIMED_OUT
|
|
80
|
+
ERR_DUPLICATE_KEY_VALUE = 23505
|
|
81
|
+
ERR_QUERY_TIMED_OUT = 57014
|
|
82
|
+
ERR_QUERY_TIMED_OUT_MESSAGE = /Query has timed out/
|
|
82
83
|
|
|
83
84
|
attr_reader :database_metadata
|
|
84
85
|
|
|
@@ -168,10 +169,12 @@ module ActiveRecord
|
|
|
168
169
|
end
|
|
169
170
|
|
|
170
171
|
def translate_exception(exception, message)
|
|
172
|
+
error_number = exception.message[/^\d+/].to_i
|
|
173
|
+
|
|
171
174
|
case
|
|
172
|
-
when
|
|
175
|
+
when error_number == ERR_DUPLICATE_KEY_VALUE
|
|
173
176
|
ActiveRecord::RecordNotUnique.new(message, exception)
|
|
174
|
-
when exception.message =~
|
|
177
|
+
when error_number == ERR_QUERY_TIMED_OUT, exception.message =~ ERR_QUERY_TIMED_OUT_MESSAGE
|
|
175
178
|
::ODBCAdapter::QueryTimeoutError.new(message, exception)
|
|
176
179
|
else
|
|
177
180
|
super
|
data/lib/odbc_adapter/version.rb
CHANGED