Skip to content

Commit 401d7a8

Browse files
committed
Merge branch 'master' of github.com:brianmario/mysql2
2 parents 77e6901 + 1a14f06 commit 401d7a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/mysql2/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,10 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
311311
result = (MYSQL_RES *)rb_thread_blocking_region(nogvl_store_result, wrapper, RUBY_UBF_IO, 0);
312312

313313
if (result == NULL) {
314-
if (mysql_field_count(wrapper->client) != 0) {
314+
if (mysql_errno(wrapper->client) != 0) {
315315
rb_raise_mysql2_error(wrapper);
316316
}
317+
// no data and no error, so query was not a SELECT
317318
return Qnil;
318319
}
319320

0 commit comments

Comments
 (0)