16
16
17
17
VALUE cMysql2Client ;
18
18
extern VALUE mMysql2 , cMysql2Error , cMysql2TimeoutError ;
19
- static VALUE sym_id , sym_version , sym_header_version , sym_async , sym_symbolize_keys , sym_as , sym_array , sym_stream ;
19
+ static VALUE sym_id , sym_version , sym_header_version , sym_async , sym_symbolize_keys , sym_as , sym_array , sym_stream , sym_has_vio_is_connected ;
20
20
static VALUE sym_no_good_index_used , sym_no_index_used , sym_query_was_slow ;
21
21
static ID intern_brackets , intern_merge , intern_merge_bang , intern_new_with_args ;
22
22
@@ -953,6 +953,11 @@ static VALUE _mysql_client_options(VALUE self, int opt, VALUE value) {
953
953
*/
954
954
static VALUE rb_mysql_client_info (RB_MYSQL_UNUSED VALUE klass ) {
955
955
VALUE version_info , version , header_version ;
956
+ #if defined(HAVE_VIO_IS_CONNECTED )
957
+ VALUE has_vio_is_connected = Qtrue ;
958
+ #else
959
+ VALUE has_vio_is_connected = Qfalse ;
960
+ #endif
956
961
version_info = rb_hash_new ();
957
962
958
963
version = rb_str_new2 (mysql_get_client_info ());
@@ -964,6 +969,7 @@ static VALUE rb_mysql_client_info(RB_MYSQL_UNUSED VALUE klass) {
964
969
rb_hash_aset (version_info , sym_id , LONG2NUM (mysql_get_client_version ()));
965
970
rb_hash_aset (version_info , sym_version , version );
966
971
rb_hash_aset (version_info , sym_header_version , header_version );
972
+ rb_hash_aset (version_info , sym_has_vio_is_connected , has_vio_is_connected );
967
973
968
974
return version_info ;
969
975
}
@@ -1372,14 +1378,6 @@ static VALUE initialize_ext(VALUE self) {
1372
1378
return self ;
1373
1379
}
1374
1380
1375
- static VALUE rb_vio_is_connected (VALUE self ) {
1376
- #if defined(HAVE_VIO_IS_CONNECTED )
1377
- return Qtrue ;
1378
- #else
1379
- return Qfalse ;
1380
- #endif
1381
- }
1382
-
1383
1381
/* call-seq: client.prepare # => Mysql2::Statement
1384
1382
*
1385
1383
* Create a new prepared statement.
@@ -1469,16 +1467,15 @@ void init_mysql2_client() {
1469
1467
rb_define_private_method (cMysql2Client , "connect" , rb_mysql_connect , 8 );
1470
1468
rb_define_private_method (cMysql2Client , "_query" , rb_mysql_query , 2 );
1471
1469
1472
- rb_define_private_method (cMysql2Client , "_has_vio_is_connected?" , rb_vio_is_connected , 0 );
1473
-
1474
- sym_id = ID2SYM (rb_intern ("id" ));
1475
- sym_version = ID2SYM (rb_intern ("version" ));
1476
- sym_header_version = ID2SYM (rb_intern ("header_version" ));
1477
- sym_async = ID2SYM (rb_intern ("async" ));
1478
- sym_symbolize_keys = ID2SYM (rb_intern ("symbolize_keys" ));
1479
- sym_as = ID2SYM (rb_intern ("as" ));
1480
- sym_array = ID2SYM (rb_intern ("array" ));
1481
- sym_stream = ID2SYM (rb_intern ("stream" ));
1470
+ sym_id = ID2SYM (rb_intern ("id" ));
1471
+ sym_version = ID2SYM (rb_intern ("version" ));
1472
+ sym_header_version = ID2SYM (rb_intern ("header_version" ));
1473
+ sym_async = ID2SYM (rb_intern ("async" ));
1474
+ sym_symbolize_keys = ID2SYM (rb_intern ("symbolize_keys" ));
1475
+ sym_as = ID2SYM (rb_intern ("as" ));
1476
+ sym_array = ID2SYM (rb_intern ("array" ));
1477
+ sym_stream = ID2SYM (rb_intern ("stream" ));
1478
+ sym_has_vio_is_connected = ID2SYM (rb_intern ("has_vio_is_connected" ));
1482
1479
1483
1480
sym_no_good_index_used = ID2SYM (rb_intern ("no_good_index_used" ));
1484
1481
sym_no_index_used = ID2SYM (rb_intern ("no_index_used" ));
0 commit comments