Skip to content

Commit b4243e9

Browse files
committed
Raise error if dbsqlsend fails
1 parent 96e552e commit b4243e9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Drop support for Ruby < 2.7
44
* Drop support for SQL Server < 2017
55
* Drop support for FreeTDS < 1.0
6+
* Raise error if FreeTDS is unable to sent command buffer to the server
67

78
## 2.1.7
89
* Add Ruby 3.3 to the cross compile list

ext/tiny_tds/client.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ static VALUE rb_tinytds_execute(VALUE self, VALUE sql) {
299299
REQUIRE_OPEN_CLIENT(cwrap);
300300
dbcmd(cwrap->client, StringValueCStr(sql));
301301
if (dbsqlsend(cwrap->client) == FAIL) {
302-
rb_warn("TinyTds: dbsqlsend() returned FAIL.\n");
303-
return Qfalse;
302+
rb_raise(cTinyTdsError, "failed dbsqlsend() function");
304303
}
305304
cwrap->userdata->dbsql_sent = 1;
306305
result = rb_tinytds_new_result_obj(cwrap);

0 commit comments

Comments
 (0)