Skip to content

Commit e019c0e

Browse files
committed
fix win32 build
1 parent 57aabc0 commit e019c0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/mysql2/client.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,10 @@ static VALUE rb_mysql_client_query(int argc, VALUE * argv, VALUE self) {
460460
}
461461

462462
args.wrapper = wrapper;
463-
rb_rescue2(do_send_query, (VALUE)&args, disconnect_and_raise, self, rb_eException, (VALUE)0);
464463

465464
#ifndef _WIN32
465+
rb_rescue2(do_send_query, (VALUE)&args, disconnect_and_raise, self, rb_eException, (VALUE)0);
466+
466467
if (!async) {
467468
async_args.fd = wrapper->client->net.fd;
468469
async_args.self = self;
@@ -474,6 +475,7 @@ static VALUE rb_mysql_client_query(int argc, VALUE * argv, VALUE self) {
474475
return Qnil;
475476
}
476477
#else
478+
rb_ensure(do_send_query, (VALUE)&args, finish_and_mark_inactive, self);
477479
// this will just block until the result is ready
478480
return rb_ensure(rb_mysql_client_async_result, self, finish_and_mark_inactive, self);
479481
#endif
@@ -887,4 +889,4 @@ void init_mysql2_client() {
887889
rb_const_set(cMysql2Client, rb_intern("BASIC_FLAGS"),
888890
INT2NUM(CLIENT_BASIC_FLAGS));
889891
#endif
890-
}
892+
}

0 commit comments

Comments
 (0)