@@ -259,7 +259,7 @@ static VALUE allocate(VALUE klass) {
259
259
mysql_client_wrapper * wrapper ;
260
260
obj = Data_Make_Struct (klass , mysql_client_wrapper , rb_mysql_client_mark , rb_mysql_client_free , wrapper );
261
261
wrapper -> encoding = Qnil ;
262
- MARK_CONN_INACTIVE ( self ) ;
262
+ wrapper -> active_thread = Qnil ;
263
263
wrapper -> automatic_close = 1 ;
264
264
wrapper -> server_version = 0 ;
265
265
wrapper -> reconnect_enabled = 0 ;
@@ -373,7 +373,7 @@ static VALUE rb_connect(VALUE self, VALUE user, VALUE pass, VALUE host, VALUE po
373
373
if (wrapper -> connect_timeout )
374
374
mysql_options (wrapper -> client , MYSQL_OPT_CONNECT_TIMEOUT , & wrapper -> connect_timeout );
375
375
if (rv == Qfalse )
376
- return rb_raise_mysql2_error (wrapper );
376
+ rb_raise_mysql2_error (wrapper );
377
377
}
378
378
379
379
wrapper -> server_version = mysql_get_server_version (wrapper -> client );
@@ -418,8 +418,8 @@ static VALUE do_send_query(void *args) {
418
418
mysql_client_wrapper * wrapper = query_args -> wrapper ;
419
419
if ((VALUE )rb_thread_call_without_gvl (nogvl_send_query , args , RUBY_UBF_IO , 0 ) == Qfalse ) {
420
420
/* an error occurred, we're not active anymore */
421
- MARK_CONN_INACTIVE ( self ) ;
422
- return rb_raise_mysql2_error (wrapper );
421
+ wrapper -> active_thread = Qnil ;
422
+ rb_raise_mysql2_error (wrapper );
423
423
}
424
424
return Qnil ;
425
425
}
@@ -448,7 +448,7 @@ static void *nogvl_do_result(void *ptr, char use_result) {
448
448
449
449
/* once our result is stored off, this connection is
450
450
ready for another command to be issued */
451
- MARK_CONN_INACTIVE ( self ) ;
451
+ wrapper -> active_thread = Qnil ;
452
452
453
453
return result ;
454
454
}
@@ -480,8 +480,8 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
480
480
REQUIRE_CONNECTED (wrapper );
481
481
if ((VALUE )rb_thread_call_without_gvl (nogvl_read_query_result , wrapper -> client , RUBY_UBF_IO , 0 ) == Qfalse ) {
482
482
/* an error occurred, mark this connection inactive */
483
- MARK_CONN_INACTIVE ( self ) ;
484
- return rb_raise_mysql2_error (wrapper );
483
+ wrapper -> active_thread = Qnil ;
484
+ rb_raise_mysql2_error (wrapper );
485
485
}
486
486
487
487
is_streaming = rb_hash_aref (rb_iv_get (self , "@current_query_options" ), sym_stream );
@@ -493,7 +493,7 @@ static VALUE rb_mysql_client_async_result(VALUE self) {
493
493
494
494
if (result == NULL ) {
495
495
if (mysql_errno (wrapper -> client ) != 0 ) {
496
- MARK_CONN_INACTIVE ( self ) ;
496
+ wrapper -> active_thread = Qnil ;
497
497
rb_raise_mysql2_error (wrapper );
498
498
}
499
499
/* no data and no error, so query was not a SELECT */
@@ -517,7 +517,7 @@ struct async_query_args {
517
517
static VALUE disconnect_and_raise (VALUE self , VALUE error ) {
518
518
GET_CLIENT (self );
519
519
520
- MARK_CONN_INACTIVE ( self ) ;
520
+ wrapper -> active_thread = Qnil ;
521
521
wrapper -> connected = 0 ;
522
522
523
523
/* Invalidate the MySQL socket to prevent further communication.
@@ -588,7 +588,7 @@ static VALUE finish_and_mark_inactive(void *args) {
588
588
result = (MYSQL_RES * )rb_thread_call_without_gvl (nogvl_store_result , wrapper , RUBY_UBF_IO , 0 );
589
589
mysql_free_result (result );
590
590
591
- MARK_CONN_INACTIVE ( self ) ;
591
+ wrapper -> active_thread = Qnil ;
592
592
}
593
593
594
594
return Qnil ;
@@ -1011,10 +1011,10 @@ static VALUE rb_mysql_client_ping(VALUE self) {
1011
1011
static VALUE rb_mysql_client_more_results (VALUE self )
1012
1012
{
1013
1013
GET_CLIENT (self );
1014
- if (mysql_more_results (wrapper -> client ) == 0 )
1015
- return Qfalse ;
1016
- else
1017
- return Qtrue ;
1014
+ if (mysql_more_results (wrapper -> client ) == 0 )
1015
+ return Qfalse ;
1016
+ else
1017
+ return Qtrue ;
1018
1018
}
1019
1019
1020
1020
/* call-seq:
@@ -1228,7 +1228,7 @@ static VALUE initialize_ext(VALUE self) {
1228
1228
1229
1229
if ((VALUE )rb_thread_call_without_gvl (nogvl_init , wrapper , RUBY_UBF_IO , 0 ) == Qfalse ) {
1230
1230
/* TODO: warning - not enough memory? */
1231
- return rb_raise_mysql2_error (wrapper );
1231
+ rb_raise_mysql2_error (wrapper );
1232
1232
}
1233
1233
1234
1234
wrapper -> initialized = 1 ;
0 commit comments