Skip to content

Handle false return by TinyTDS if connection fails and fixed CI #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ clone_depth: 5
build: off
matrix:
fast_finish: true

allow_failures:
- ruby_version: "25"
- ruby_version: "26"
- ruby_version: "27"
- ruby_version: "27-x64"
services:
- mssql2014

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ def sp_executesql_sql(sql, types, params, name)
def raw_connection_do(sql)
case @connection_options[:mode]
when :dblib
@connection.execute(sql).do
result = @connection.execute(sql)
# If connection fails then TinyTDS returns false instead of an exception (see https://github.com/rails-sqlserver/tiny_tds/issues/464)
if result == false
raise TinyTds::Error, 'TinyTDS execute returned false instead of results'
end
result.do
end
ensure
@update_sql = false
Expand Down