Skip to content

Commit 0197f21

Browse files
committed
attempt to avoid race condition with active connections
1 parent b4902e9 commit 0197f21

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/mysql2/client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
312312

313313
if (result == NULL) {
314314
if (mysql_errno(wrapper->client) != 0) {
315+
MARK_CONN_INACTIVE(self);
315316
rb_raise_mysql2_error(wrapper);
316317
}
317318
// no data and no error, so query was not a SELECT

0 commit comments

Comments
 (0)