@@ -32,14 +32,14 @@ typedef struct {
32
32
VALUE block_given ;
33
33
} result_each_args ;
34
34
35
- VALUE cBigDecimal , cDateTime , cDate ;
36
- static VALUE cMysql2Result ;
37
- static VALUE opt_decimal_zero , opt_float_zero , opt_time_year , opt_time_month , opt_utc_offset ;
38
35
extern VALUE mMysql2 , cMysql2Client , cMysql2Error ;
39
- static ID intern_new , intern_utc , intern_local , intern_localtime , intern_local_offset , intern_civil , intern_new_offset ;
40
- static VALUE sym_symbolize_keys , sym_as , sym_array , sym_database_timezone , sym_application_timezone ,
41
- sym_local , sym_utc , sym_cast_booleans , sym_cache_rows , sym_cast , sym_stream , sym_name ;
42
- static ID intern_merge ;
36
+ static VALUE cMysql2Result , cDateTime , cDate ;
37
+ static VALUE opt_decimal_zero , opt_float_zero , opt_time_year , opt_time_month , opt_utc_offset ;
38
+ static ID intern_new , intern_utc , intern_local , intern_localtime , intern_local_offset ,
39
+ intern_civil , intern_new_offset , intern_merge , intern_BigDecimal ;
40
+ static VALUE sym_symbolize_keys , sym_as , sym_array , sym_database_timezone ,
41
+ sym_application_timezone , sym_local , sym_utc , sym_cast_booleans ,
42
+ sym_cache_rows , sym_cast , sym_stream , sym_name ;
43
43
44
44
/* Mark any VALUEs that are only referenced in C, so the GC won't get them. */
45
45
static void rb_mysql_result_mark (void * wrapper ) {
@@ -444,7 +444,7 @@ static VALUE rb_mysql_result_fetch_row_stmt(VALUE self, MYSQL_FIELD * fields, co
444
444
}
445
445
case MYSQL_TYPE_DECIMAL : // char[]
446
446
case MYSQL_TYPE_NEWDECIMAL : // char[]
447
- val = rb_funcall (cBigDecimal , intern_new , 1 , rb_str_new (result_buffer -> buffer , * (result_buffer -> length )));
447
+ val = rb_funcall (rb_mKernel , intern_BigDecimal , 1 , rb_str_new (result_buffer -> buffer , * (result_buffer -> length )));
448
448
break ;
449
449
case MYSQL_TYPE_STRING : // char[]
450
450
case MYSQL_TYPE_VAR_STRING : // char[]
@@ -546,9 +546,9 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, MYSQL_FIELD * fields, const r
546
546
if (fields [i ].decimals == 0 ) {
547
547
val = rb_cstr2inum (row [i ], 10 );
548
548
} else if (strtod (row [i ], NULL ) == 0.000000 ){
549
- val = rb_funcall (cBigDecimal , intern_new , 1 , opt_decimal_zero );
549
+ val = rb_funcall (rb_mKernel , intern_BigDecimal , 1 , opt_decimal_zero );
550
550
}else {
551
- val = rb_funcall (cBigDecimal , intern_new , 1 , rb_str_new (row [i ], fieldLengths [i ]));
551
+ val = rb_funcall (rb_mKernel , intern_BigDecimal , 1 , rb_str_new (row [i ], fieldLengths [i ]));
552
552
}
553
553
break ;
554
554
case MYSQL_TYPE_FLOAT : /* FLOAT field */
@@ -959,7 +959,6 @@ VALUE rb_mysql_result_to_obj(VALUE client, VALUE encoding, VALUE options, MYSQL_
959
959
}
960
960
961
961
void init_mysql2_result () {
962
- cBigDecimal = rb_const_get (rb_cObject , rb_intern ("BigDecimal" ));
963
962
cDate = rb_const_get (rb_cObject , rb_intern ("Date" ));
964
963
cDateTime = rb_const_get (rb_cObject , rb_intern ("DateTime" ));
965
964
@@ -978,6 +977,7 @@ void init_mysql2_result() {
978
977
intern_local_offset = rb_intern ("local_offset" );
979
978
intern_civil = rb_intern ("civil" );
980
979
intern_new_offset = rb_intern ("new_offset" );
980
+ intern_BigDecimal = rb_intern ("BigDecimal" );
981
981
982
982
sym_symbolize_keys = ID2SYM (rb_intern ("symbolize_keys" ));
983
983
sym_as = ID2SYM (rb_intern ("as" ));
0 commit comments