Skip to content

Commit cbb1796

Browse files
committed
Updated Ruby matrix and handle TinyTDS false result
1 parent 4ce7785 commit cbb1796

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ environment:
3434
CI_AZURE_PASS:
3535
secure: cSQp8sk4urJYvq0utpsK+r7J+snJ2wpcdp8RdXJfB+w=
3636
matrix:
37+
# - ruby_version: "25" # Fails because of "File does not exist: tiny_tds/tiny_tds" error (See https://github.com/rails-sqlserver/tiny_tds/issues/391).
3738
- ruby_version: "25-x64"
38-
- ruby_version: "25"
39+
# - ruby_version: "26" # Fails because of "File does not exist: tiny_tds/tiny_tds" error (See https://github.com/rails-sqlserver/tiny_tds/issues/391).
3940
- ruby_version: "26-x64"
40-
- ruby_version: "26"
41-
- ruby_version: "27-x64"
42-
- ruby_version: "27"
41+
# - ruby_version: "27" # Ruby version not installed on AppVeyor Windows instance.
42+
# - ruby_version: "27-x64" # Ruby version not installed on AppVeyor Windows instance.

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,10 @@ def raw_connection_do(sql)
351351
case @connection_options[:mode]
352352
when :dblib
353353
result = @connection.execute(sql)
354-
raise ActiveRecordError, 'Database connection has failed' if result == false
354+
# If connection fails then TinyTDS returns false instead of an exception (see https://github.com/rails-sqlserver/tiny_tds/issues/464)
355+
if result == false
356+
raise TinyTds::Error, 'TinyTDS execute returned false instead of results'
357+
end
355358
result.do
356359
end
357360
ensure

0 commit comments

Comments
 (0)