Skip to content

Commit ba8db81

Browse files
committed
Updated Ruby AppVeyor matrix and handle TinyTDS false result
1 parent e6e0f29 commit ba8db81

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,12 @@ def sp_executesql_sql(sql, types, params, name)
350350
def raw_connection_do(sql)
351351
case @connection_options[:mode]
352352
when :dblib
353-
@connection.execute(sql).do
353+
result = @connection.execute(sql)
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
358+
result.do
354359
end
355360
ensure
356361
@update_sql = false

0 commit comments

Comments
 (0)