Skip to content

Commit 19d93b5

Browse files
committed
Avoid GC run between mysql_stmt_execute and mysql_stmt_store_result
Fixes #694.
1 parent 46fa2cf commit 19d93b5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

ext/mysql2/statement.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,6 @@ static void *nogvl_execute(void *ptr) {
177177
}
178178
}
179179

180-
static void *nogvl_stmt_store_result(void *ptr) {
181-
MYSQL_STMT *stmt = ptr;
182-
183-
if (mysql_stmt_store_result(stmt)) {
184-
return (void *)Qfalse;
185-
} else {
186-
return (void *)Qtrue;
187-
}
188-
}
189-
190180
static void set_buffer_for_string(MYSQL_BIND* bind_buffer, unsigned long *length_buffer, VALUE string) {
191181
int length;
192182

@@ -380,7 +370,7 @@ static VALUE execute(int argc, VALUE *argv, VALUE self) {
380370
is_streaming = (Qtrue == rb_hash_aref(current, sym_stream));
381371
if (!is_streaming) {
382372
// recieve the whole result set from the server
383-
if (rb_thread_call_without_gvl(nogvl_stmt_store_result, stmt, RUBY_UBF_IO, 0) == Qfalse) {
373+
if (mysql_stmt_store_result(stmt)) {
384374
mysql_free_result(metadata);
385375
rb_raise_mysql2_stmt_error(stmt_wrapper);
386376
}

0 commit comments

Comments
 (0)