From b4243e9f78b7ffdd10f85c712df42d692bdf4248 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Wed, 8 May 2024 22:11:02 +0200 Subject: [PATCH] Raise error if dbsqlsend fails --- CHANGELOG.md | 1 + ext/tiny_tds/client.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b104671a..0c7e7ab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Drop support for Ruby < 2.7 * Drop support for SQL Server < 2017 * Drop support for FreeTDS < 1.0 +* Raise error if FreeTDS is unable to sent command buffer to the server ## 2.1.7 * Add Ruby 3.3 to the cross compile list diff --git a/ext/tiny_tds/client.c b/ext/tiny_tds/client.c index 11c15dd9..03a1b4b5 100644 --- a/ext/tiny_tds/client.c +++ b/ext/tiny_tds/client.c @@ -299,8 +299,7 @@ static VALUE rb_tinytds_execute(VALUE self, VALUE sql) { REQUIRE_OPEN_CLIENT(cwrap); dbcmd(cwrap->client, StringValueCStr(sql)); if (dbsqlsend(cwrap->client) == FAIL) { - rb_warn("TinyTds: dbsqlsend() returned FAIL.\n"); - return Qfalse; + rb_raise(cTinyTdsError, "failed dbsqlsend() function"); } cwrap->userdata->dbsql_sent = 1; result = rb_tinytds_new_result_obj(cwrap);