File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -263,8 +263,17 @@ static VALUE nogvl_read_query_result(void *ptr) {
263
263
264
264
/* mysql_store_result may (unlikely) read rows off the socket */
265
265
static VALUE nogvl_store_result (void * ptr ) {
266
- MYSQL * client = ptr ;
267
- return (VALUE )mysql_store_result (client );
266
+ mysql_client_wrapper * wrapper ;
267
+ MYSQL_RES * result ;
268
+
269
+ wrapper = (mysql_client_wrapper * )ptr ;
270
+ result = mysql_store_result (wrapper -> client );
271
+
272
+ // once our result is stored off, this connection is
273
+ // ready for another command to be issued
274
+ wrapper -> active = 0 ;
275
+
276
+ return (VALUE )result ;
268
277
}
269
278
270
279
static VALUE rb_mysql_client_async_result (VALUE self ) {
@@ -286,10 +295,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
286
295
return rb_raise_mysql2_error (wrapper );
287
296
}
288
297
289
- result = (MYSQL_RES * )rb_thread_blocking_region (nogvl_store_result , wrapper -> client , RUBY_UBF_IO , 0 );
290
-
291
- // we have our result, mark this connection inactive
292
- MARK_CONN_INACTIVE (self );
298
+ result = (MYSQL_RES * )rb_thread_blocking_region (nogvl_store_result , wrapper , RUBY_UBF_IO , 0 );
293
299
294
300
if (result == NULL ) {
295
301
if (mysql_field_count (wrapper -> client ) != 0 ) {
You can’t perform that action at this time.
0 commit comments