@@ -364,9 +364,6 @@ static VALUE nogvl_use_result(void *ptr) {
364
364
static VALUE rb_mysql_client_async_result (VALUE self ) {
365
365
MYSQL_RES * result ;
366
366
VALUE resultObj ;
367
- #ifdef HAVE_RUBY_ENCODING_H
368
- mysql2_result_wrapper * result_wrapper ;
369
- #endif
370
367
GET_CLIENT (self );
371
368
372
369
/* if we're not waiting on a result, do nothing */
@@ -396,14 +393,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
396
393
return Qnil ;
397
394
}
398
395
399
- resultObj = rb_mysql_result_to_obj (self , result );
400
- /* pass-through query options for result construction later */
401
- rb_iv_set (resultObj , "@query_options" , rb_hash_dup (rb_iv_get (self , "@current_query_options" )));
402
-
403
- #ifdef HAVE_RUBY_ENCODING_H
404
- GetMysql2Result (resultObj , result_wrapper );
405
- result_wrapper -> encoding = wrapper -> encoding ;
406
- #endif
396
+ resultObj = rb_mysql_result_to_obj (self , wrapper -> encoding , rb_hash_dup (rb_iv_get (self , "@current_query_options" )), result );
407
397
return resultObj ;
408
398
}
409
399
@@ -929,10 +919,6 @@ static VALUE rb_mysql_client_store_result(VALUE self)
929
919
{
930
920
MYSQL_RES * result ;
931
921
VALUE resultObj ;
932
- #ifdef HAVE_RUBY_ENCODING_H
933
- mysql2_result_wrapper * result_wrapper ;
934
- #endif
935
-
936
922
GET_CLIENT (self );
937
923
938
924
result = (MYSQL_RES * )rb_thread_blocking_region (nogvl_store_result , wrapper , RUBY_UBF_IO , 0 );
@@ -945,14 +931,7 @@ static VALUE rb_mysql_client_store_result(VALUE self)
945
931
return Qnil ;
946
932
}
947
933
948
- resultObj = rb_mysql_result_to_obj (self , result );
949
- /* pass-through query options for result construction later */
950
- rb_iv_set (resultObj , "@query_options" , rb_hash_dup (rb_iv_get (self , "@current_query_options" )));
951
-
952
- #ifdef HAVE_RUBY_ENCODING_H
953
- GetMysql2Result (resultObj , result_wrapper );
954
- result_wrapper -> encoding = wrapper -> encoding ;
955
- #endif
934
+ resultObj = rb_mysql_result_to_obj (self , wrapper -> encoding , rb_hash_dup (rb_iv_get (self , "@current_query_options" )), result );
956
935
return resultObj ;
957
936
958
937
}
0 commit comments