#include <decimal.h>Include dependency graph for my_decimal.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define DECIMAL_BUFF_LENGTH 9 |
Definition at line 39 of file my_decimal.h.
Referenced by my_decimal::init(), and in_decimal::set().
| #define DECIMAL_LONG3_DIGITS 8 |
Definition at line 36 of file my_decimal.h.
| #define DECIMAL_LONG_DIGITS 10 |
Definition at line 35 of file my_decimal.h.
| #define DECIMAL_LONGLONG_DIGITS 22 |
| #define DECIMAL_MAX_FIELD_SIZE DECIMAL_MAX_PRECISION |
Definition at line 58 of file my_decimal.h.
Referenced by field_decimal::add(), and User_var_log_event::write().
| #define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2) |
Definition at line 46 of file my_decimal.h.
Referenced by Item_func::count_decimal_length(), Item_func_case::decimal_precision(), Item_func_if::decimal_precision(), Item_func_ifnull::decimal_precision(), Item::decimal_precision(), Field_new_decimal::Field_new_decimal(), Item_sum_variance::fix_length_and_dec(), Item_sum_avg::fix_length_and_dec(), create_field::init(), Item_type_holder::join_types(), max_internal_decimal(), max_my_decimal(), my_decimal_precision_to_length(), Item_func_div::result_precision(), Item_func_mul::result_precision(), and Item_func_additive_op::result_precision().
| #define DECIMAL_MAX_SCALE 30 |
Definition at line 47 of file my_decimal.h.
Referenced by field_decimal::avg(), Item_func_round::decimal_op(), Field_new_decimal::Field_new_decimal(), Item_sum_variance::fix_length_and_dec(), Item_sum_avg::fix_length_and_dec(), Item_func_get_user_var::fix_length_and_dec(), Item_type_holder::join_types(), max_my_decimal(), Item_func_div::result_precision(), and Item_func_mul::result_precision().
| #define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2) |
Definition at line 54 of file my_decimal.h.
Referenced by collect_decimal(), dbug_decimal_as_string(), Item_func_get_user_var::fix_length_and_dec(), Hybrid_type_traits_decimal::fix_length_and_dec(), Field_new_decimal::store(), Field_longstr::store_decimal(), Protocol_prep::store_decimal(), Protocol_simple::store_decimal(), and Field_new_decimal::store_value().
| #define DECIMAL_NOT_SPECIFIED 31 |
| int binary2my_decimal | ( | uint | mask, | |
| const char * | bin, | |||
| my_decimal * | d, | |||
| int | prec, | |||
| int | scale | |||
| ) | [inline] |
Definition at line 209 of file my_decimal.h.
References bin2decimal(), and check_result().
Referenced by collect_decimal(), Item_decimal::Item_decimal(), Item_sum_avg::update_field(), Item_sum_variance::update_field(), Item_variance_field::val_decimal(), Item_avg_field::val_decimal(), and Field_new_decimal::val_decimal().
00211 { 00212 return check_result(mask, bin2decimal((char *)bin, (decimal_t*) d, prec, 00213 scale)); 00214 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int check_result | ( | uint | mask, | |
| int | result | |||
| ) | [inline] |
Definition at line 142 of file my_decimal.h.
References decimal_operation_results().
Referenced by binary2my_decimal(), check_result_and_overflow(), int2my_decimal(), main(), my_decimal2binary(), my_decimal2int(), my_decimal2string(), my_decimal_ceiling(), my_decimal_floor(), my_decimal_round(), and run_query().
00143 { 00144 if (result & mask) 00145 decimal_operation_results(result); 00146 return result; 00147 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int check_result_and_overflow | ( | uint | mask, | |
| int | result, | |||
| my_decimal * | val | |||
| ) | [inline] |
Definition at line 149 of file my_decimal.h.
References check_result(), E_DEC_OVERFLOW, my_decimal::fix_buffer_pointer(), max_internal_decimal(), and my_decimal::sign().
Referenced by double2my_decimal(), my_decimal_add(), my_decimal_div(), my_decimal_mod(), my_decimal_mul(), my_decimal_sub(), and str2my_decimal().
00150 { 00151 if (check_result(mask, result) & E_DEC_OVERFLOW) 00152 { 00153 bool sign= val->sign(); 00154 val->fix_buffer_pointer(); 00155 max_internal_decimal(val); 00156 val->sign(sign); 00157 } 00158 return result; 00159 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* dbug_decimal_as_string | ( | char * | buff, | |
| const my_decimal * | val | |||
| ) |
Definition at line 230 of file my_decimal.cc.
00231 { 00232 int length= DECIMAL_MAX_STR_LENGTH; 00233 if (!val) 00234 return "NULL"; 00235 (void)decimal2string((decimal_t*) val, buff, &length, 0,0,0); 00236 return buff; 00237 }
| int decimal_operation_results | ( | int | result | ) |
Definition at line 34 of file my_decimal.cc.
00035 { 00036 switch (result) { 00037 case E_DEC_OK: 00038 break; 00039 case E_DEC_TRUNCATED: 00040 push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, 00041 WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED), 00042 "", (long)-1); 00043 break; 00044 case E_DEC_OVERFLOW: 00045 push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, 00046 ER_TRUNCATED_WRONG_VALUE, 00047 ER(ER_TRUNCATED_WRONG_VALUE), 00048 "DECIMAL", ""); 00049 break; 00050 case E_DEC_DIV_ZERO: 00051 push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, 00052 ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO)); 00053 break; 00054 case E_DEC_BAD_NUM: 00055 push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, 00056 ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, 00057 ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), 00058 "decimal", "", "", (long)-1); 00059 break; 00060 case E_DEC_OOM: 00061 my_error(ER_OUT_OF_RESOURCES, MYF(0)); 00062 break; 00063 default: 00064 DBUG_ASSERT(0); 00065 } 00066 return result; 00067 }
| int double2my_decimal | ( | uint | mask, | |
| double | val, | |||
| my_decimal * | d | |||
| ) | [inline] |
Definition at line 301 of file my_decimal.h.
References check_result_and_overflow(), and double2decimal().
Referenced by Item_decimal::Item_decimal(), Field_new_decimal::store(), Item_proc_real::val_decimal(), Item_std_field::val_decimal(), Item_sum_hybrid::val_decimal(), Item_func_numhybrid::val_decimal(), Item_real_func::val_decimal(), Item_cache_real::val_decimal(), Item_param::val_decimal(), Item_float::val_decimal(), Hybrid_type_traits::val_decimal(), Field_real::val_decimal(), and Item::val_decimal_from_real().
00302 { 00303 return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); 00304 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int int2my_decimal | ( | uint | mask, | |
| longlong | i, | |||
| my_bool | unsigned_flag, | |||
| my_decimal * | d | |||
| ) | [inline] |
Definition at line 308 of file my_decimal.h.
References check_result(), longlong2decimal(), and ulonglong2decimal().
Referenced by field_decimal::avg(), Hybrid_type_traits_fast_decimal::div(), Hybrid_type_traits_decimal::div(), Item_decimal::Item_decimal(), field_decimal::std(), Field_new_decimal::store(), Item_proc_int::val_decimal(), Item_variance_field::val_decimal(), Item_avg_field::val_decimal(), Item_sum_hybrid::val_decimal(), Item_sum_variance::val_decimal(), Item_sum_avg::val_decimal(), Item_in_subselect::val_decimal(), Item_exists_subselect::val_decimal(), Item_func_numhybrid::val_decimal(), Item_func::val_decimal(), Hybrid_type_traits_integer::val_decimal(), Item_cache_int::val_decimal(), Item_hex_string::val_decimal(), Item_param::val_decimal(), Item_int::val_decimal(), Field_bit::val_decimal(), Field_str::val_decimal(), Field_num::val_decimal(), and Item::val_decimal_from_int().
00309 { 00310 return check_result(mask, (unsigned_flag ? 00311 ulonglong2decimal((ulonglong)i, d) : 00312 longlong2decimal(i, d))); 00313 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void max_internal_decimal | ( | my_decimal * | to | ) | [inline] |
Definition at line 137 of file my_decimal.h.
References DECIMAL_MAX_PRECISION, max_my_decimal(), and to.
Referenced by check_result_and_overflow().
00138 { 00139 max_my_decimal(to, DECIMAL_MAX_PRECISION, 0); 00140 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void max_my_decimal | ( | my_decimal * | to, | |
| int | precision, | |||
| int | frac | |||
| ) | [inline] |
Definition at line 130 of file my_decimal.h.
References DBUG_ASSERT, DECIMAL_MAX_PRECISION, DECIMAL_MAX_SCALE, max_decimal(), and to.
Referenced by max_internal_decimal(), Field_new_decimal::set_value_on_overflow(), and Item_decimal_typecast::val_decimal().
00131 { 00132 DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& 00133 (frac <= DECIMAL_MAX_SCALE)); 00134 max_decimal(precision, frac, (decimal_t*) to); 00135 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal2binary | ( | uint | mask, | |
| const my_decimal * | d, | |||
| char * | bin, | |||
| int | prec, | |||
| int | scale | |||
| ) |
Definition at line 120 of file my_decimal.cc.
00122 { 00123 int err1= E_DEC_OK, err2; 00124 my_decimal rounded; 00125 my_decimal2decimal(d, &rounded); 00126 rounded.frac= decimal_actual_fraction(&rounded); 00127 if (scale < rounded.frac) 00128 { 00129 err1= E_DEC_TRUNCATED; 00130 /* decimal_round can return only E_DEC_TRUNCATED */ 00131 decimal_round(&rounded, &rounded, scale, HALF_UP); 00132 } 00133 err2= decimal2bin(&rounded, bin, prec, scale); 00134 if (!err2) 00135 err2= err1; 00136 return check_result(mask, err2); 00137 }
| void my_decimal2decimal | ( | const my_decimal * | from, | |
| my_decimal * | to | |||
| ) | [inline] |
Definition at line 197 of file my_decimal.h.
Referenced by Item_sum_max::add(), Item_sum_min::add(), Cached_item_decimal::cmp(), Item_func_abs::decimal_op(), Item_func_neg::decimal_op(), Item_decimal::Item_decimal(), Item_sum_hybrid::Item_sum_hybrid(), Item_sum_sum::Item_sum_sum(), my_decimal2binary(), in_decimal::set(), Item_decimal::set_decimal_value(), Item_param::set_from_user_var(), Item_cache_decimal::store(), cmp_item_decimal::store_value(), and Item_func_min_max::val_decimal().
Here is the caller graph for this function:

| int my_decimal2double | ( | uint | mask, | |
| const my_decimal * | d, | |||
| double * | result | |||
| ) | [inline] |
Definition at line 274 of file my_decimal.h.
References decimal2double().
Referenced by field_decimal::std(), Field_new_decimal::store(), Field_real::store_decimal(), Field_str::store_decimal(), Item_std_field::val_decimal(), Item_func_interval::val_int(), Item_std_field::val_real(), Item_sum_hybrid::val_real(), Item_sum_sum::val_real(), Item_decimal_typecast::val_real(), Item_func_numhybrid::val_real(), Item_cache_decimal::val_real(), Item_param::val_real(), Item_decimal::val_real(), Hybrid_type_traits_decimal::val_real(), Field_new_decimal::val_real(), and Item::val_real_from_decimal().
00275 { 00276 /* No need to call check_result as this will always succeed */ 00277 return decimal2double((decimal_t*) d, result); 00278 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal2int | ( | uint | mask, | |
| const my_decimal * | d, | |||
| my_bool | unsigned_flag, | |||
| longlong * | l | |||
| ) | [inline] |
Definition at line 261 of file my_decimal.h.
References check_result(), decimal2longlong(), decimal2ulonglong(), decimal_round(), and HALF_UP.
Referenced by Field::convert_decimal2longlong(), Item_func_floor::int_op(), Item_func_ceiling::int_op(), Item_sum_hybrid::val_int(), Item_sum_sum::val_int(), Item_decimal_typecast::val_int(), Item_func_numhybrid::val_int(), Item_cache_decimal::val_int(), Item_param::val_int(), Item_decimal::val_int(), Hybrid_type_traits_decimal::val_int(), Field_new_decimal::val_int(), and Item::val_int_from_decimal().
00263 { 00264 my_decimal rounded; 00265 /* decimal_round can return only E_DEC_TRUNCATED */ 00266 decimal_round((decimal_t*)d, &rounded, 0, HALF_UP); 00267 return check_result(mask, (unsigned_flag ? 00268 decimal2ulonglong(&rounded, (ulonglong *)l) : 00269 decimal2longlong(&rounded, l))); 00270 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal2string | ( | uint | mask, | |
| const my_decimal * | d, | |||
| uint | fixed_prec, | |||
| uint | fixed_dec, | |||
| char | filler, | |||
| String * | str | |||
| ) |
Definition at line 83 of file my_decimal.cc.
00086 { 00087 int length= (fixed_prec ? (fixed_prec + 1) : my_decimal_string_length(d)); 00088 int result; 00089 if (str->alloc(length)) 00090 return check_result(mask, E_DEC_OOM); 00091 result= decimal2string((decimal_t*) d, (char*) str->ptr(), 00092 &length, (int)fixed_prec, fixed_dec, 00093 filler); 00094 str->length(length); 00095 return check_result(mask, result); 00096 }
| int my_decimal_add | ( | uint | mask, | |
| my_decimal * | res, | |||
| const my_decimal * | a, | |||
| const my_decimal * | b | |||
| ) | [inline] |
Definition at line 329 of file my_decimal.h.
References check_result_and_overflow(), and decimal_add().
Referenced by field_decimal::add(), Item_sum_variance::add(), Item_sum_sum::add(), Hybrid_type_traits_decimal::add(), Item_func_plus::decimal_op(), Item_sum_avg::update_field(), Item_sum_sum::update_field(), and Item_sum_variance::update_field().
00331 { 00332 return check_result_and_overflow(mask, 00333 decimal_add((decimal_t*)a,(decimal_t*)b,res), 00334 res); 00335 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_ceiling | ( | uint | mask, | |
| const my_decimal * | from, | |||
| my_decimal * | to | |||
| ) | [inline] |
Definition at line 249 of file my_decimal.h.
References CEILING, check_result(), decimal_round(), from, and to.
Referenced by Item_func_ceiling::decimal_op().
00250 { 00251 return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING)); 00252 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_cmp | ( | const my_decimal * | a, | |
| const my_decimal * | b | |||
| ) | [inline] |
Definition at line 381 of file my_decimal.h.
References decimal_cmp().
Referenced by field_decimal::add(), Item_sum_max::add(), Item_sum_min::add(), cmp_item_decimal::cmp(), Cached_item_decimal::cmp(), cmp_decimal(), cmp_item_decimal::compare(), Arg_comparator::compare_decimal(), Arg_comparator::compare_e_decimal(), Item_decimal::eq(), field_is_equal_to_item(), Item_func_case::find_item(), Item_sum_hybrid::min_max_update_decimal_field(), Item_func_min_max::val_decimal(), Item_func_field::val_int(), Item_func_between::val_int(), and Item_func_interval::val_int().
00382 { 00383 return decimal_cmp((decimal_t*) a, (decimal_t*) b); 00384 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_div | ( | uint | mask, | |
| my_decimal * | res, | |||
| const my_decimal * | a, | |||
| const my_decimal * | b, | |||
| int | div_scale_inc | |||
| ) | [inline] |
Definition at line 359 of file my_decimal.h.
References check_result_and_overflow(), and decimal_div().
Referenced by field_decimal::avg(), Item_func_div::decimal_op(), Hybrid_type_traits_decimal::div(), field_decimal::std(), Item_variance_field::val_decimal(), Item_avg_field::val_decimal(), Item_sum_variance::val_decimal(), and Item_sum_avg::val_decimal().
00361 { 00362 return check_result_and_overflow(mask, 00363 decimal_div((decimal_t*)a,(decimal_t*)b,res, 00364 div_scale_inc), 00365 res); 00366 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_floor | ( | uint | mask, | |
| const my_decimal * | from, | |||
| my_decimal * | to | |||
| ) | [inline] |
Definition at line 242 of file my_decimal.h.
References check_result(), decimal_round(), FLOOR, from, and to.
Referenced by Item_func_floor::decimal_op().
00243 { 00244 return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR)); 00245 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 190 of file my_decimal.h.
References decimal_bin_size().
Referenced by calc_group_buffer(), create_field::create_length_to_internal_length(), field_decimal::field_decimal(), Field_new_decimal::Field_new_decimal(), Item_sum_variance::fix_length_and_dec(), Item_sum_avg::fix_length_and_dec(), create_field::init(), sortlength(), and DictTabInfo::Attribute::translateExtType().
00191 { 00192 return decimal_bin_size((int)precision, (int)scale); 00193 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 71 of file my_decimal.h.
References DECIMAL_NOT_SPECIFIED.
Referenced by Item::decimal_int_part().
00072 { 00073 return precision - ((decimals == DECIMAL_NOT_SPECIFIED) ? 0 : decimals); 00074 }
Here is the caller graph for this function:

| int my_decimal_intg | ( | const my_decimal * | a | ) | [inline] |
Definition at line 388 of file my_decimal.h.
References decimal_intg().
Referenced by Item_decimal_typecast::val_decimal().
00389 { 00390 return decimal_intg((decimal_t*) a); 00391 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool my_decimal_is_zero | ( | const my_decimal * | decimal_value | ) | [inline] |
Definition at line 226 of file my_decimal.h.
References decimal_is_zero().
Referenced by Item::val_bool(), Item_ref::val_bool_result(), and Item_field::val_bool_result().
00227 { 00228 return decimal_is_zero((decimal_t*) decimal_value); 00229 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 161 of file my_decimal.h.
Referenced by create_field::create_length_to_internal_length(), Item::decimal_precision(), and Field_new_decimal::Field_new_decimal().
00163 { 00164 return (uint) (length - (scale>0 ? 1:0) - (unsigned_flag ? 0:1)); 00165 }
Here is the caller graph for this function:

| int my_decimal_max_length | ( | const my_decimal * | d | ) | [inline] |
Definition at line 182 of file my_decimal.h.
References decimal_string_size.
00183 { 00184 /* -1 because we do not count \0 */ 00185 return decimal_string_size(d) - 1; 00186 }
| int my_decimal_mod | ( | uint | mask, | |
| my_decimal * | res, | |||
| const my_decimal * | a, | |||
| const my_decimal * | b | |||
| ) | [inline] |
Definition at line 370 of file my_decimal.h.
References check_result_and_overflow(), and decimal_mod().
Referenced by Item_func_mod::decimal_op().
00372 { 00373 return check_result_and_overflow(mask, 00374 decimal_mod((decimal_t*)a,(decimal_t*)b,res), 00375 res); 00376 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_mul | ( | uint | mask, | |
| my_decimal * | res, | |||
| const my_decimal * | a, | |||
| const my_decimal * | b | |||
| ) | [inline] |
Definition at line 349 of file my_decimal.h.
References check_result_and_overflow(), and decimal_mul().
Referenced by field_decimal::add(), Item_sum_variance::add(), Item_func_mul::decimal_op(), Item_sum_variance::reset_field(), field_decimal::std(), Item_sum_variance::update_field(), Item_variance_field::val_decimal(), and Item_sum_variance::val_decimal().
00351 { 00352 return check_result_and_overflow(mask, 00353 decimal_mul((decimal_t*)a,(decimal_t*)b,res), 00354 res); 00355 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void my_decimal_neg | ( | decimal_t * | arg | ) | [inline] |
Definition at line 317 of file my_decimal.h.
References decimal_is_zero(), decimal_neg, and st_decimal_t::sign.
Referenced by Item_func_abs::decimal_op(), Item_func_neg::decimal_op(), and Item_decimal::neg().
00318 { 00319 if (decimal_is_zero(arg)) 00320 { 00321 arg->sign= 0; 00322 return; 00323 } 00324 decimal_neg(arg); 00325 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 167 of file my_decimal.h.
References DECIMAL_MAX_PRECISION, and set_if_smaller.
Referenced by Item_func::count_decimal_length(), Item_sum_variance::fix_length_and_dec(), Item_sum_avg::fix_length_and_dec(), Item_sum_sum::fix_length_and_dec(), Item_func_min_max::fix_length_and_dec(), Item_func_round::fix_length_and_dec(), create_field::init(), Item_decimal::Item_decimal(), Item_type_holder::join_types(), Item_func_div::result_precision(), Item_func_mul::result_precision(), Item_func_additive_op::result_precision(), Item_param::set_decimal(), Item_decimal::set_decimal_value(), Item_param::set_from_user_var(), and Item_func::tmp_table_field().
00169 { 00170 set_if_smaller(precision, DECIMAL_MAX_PRECISION); 00171 return (uint32)(precision + (scale>0 ? 1:0) + (unsigned_flag ? 0:1)); 00172 }
Here is the caller graph for this function:

| int my_decimal_round | ( | uint | mask, | |
| const my_decimal * | from, | |||
| int | scale, | |||
| bool | truncate, | |||
| my_decimal * | to | |||
| ) | [inline] |
Definition at line 233 of file my_decimal.h.
References check_result(), decimal_round(), from, HALF_UP, to, and TRUNCATE.
Referenced by field_decimal::add(), field_decimal::avg(), Item_func_round::decimal_op(), Item_std_field::val_decimal(), Item_decimal_typecast::val_decimal(), Item_func_format::val_str(), Item_func_numhybrid::val_str(), Item_cache_decimal::val_str(), Hybrid_type_traits_decimal::val_str(), and Item::val_string_from_decimal().
00235 { 00236 return check_result(mask, decimal_round((decimal_t*) from, to, scale, 00237 (truncate ? TRUNCATE : HALF_UP))); 00238 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_decimal_set_zero | ( | my_decimal * | d | ) | [inline] |
Definition at line 218 of file my_decimal.h.
References decimal_make_zero.
Referenced by Cached_item_decimal::Cached_item_decimal(), Item_sum_hybrid::clear(), Item_sum_variance::clear(), Item_sum_sum::clear(), Item_sum_hybrid::fix_fields(), Item_sum_variance::fix_length_and_dec(), Item_sum_sum::fix_length_and_dec(), init_common_variables(), Field_new_decimal::set_value_on_overflow(), Hybrid_type_traits_decimal::set_zero(), Field_new_decimal::store(), and Item_decimal_typecast::val_decimal().
00219 { 00220 decimal_make_zero(((decimal_t*) d)); 00221 return 0; 00222 }
Here is the caller graph for this function:

Definition at line 61 of file my_decimal.h.
References decimal_size().
00062 { 00063 /* 00064 Always allocate more space to allow library to put decimal point 00065 where it want 00066 */ 00067 return decimal_size(precision, scale) + 1; 00068 }
Here is the call graph for this function:

| int my_decimal_string_length | ( | const my_decimal * | d | ) | [inline] |
Definition at line 175 of file my_decimal.h.
References decimal_string_size.
Referenced by field_decimal::add(), and my_decimal2string().
00176 { 00177 return decimal_string_size(d); 00178 }
Here is the caller graph for this function:

| int my_decimal_sub | ( | uint | mask, | |
| my_decimal * | res, | |||
| const my_decimal * | a, | |||
| const my_decimal * | b | |||
| ) | [inline] |
Definition at line 339 of file my_decimal.h.
References check_result_and_overflow(), and decimal_sub().
Referenced by Item_func_minus::decimal_op(), field_decimal::std(), Item_variance_field::val_decimal(), and Item_sum_variance::val_decimal().
00341 { 00342 return check_result_and_overflow(mask, 00343 decimal_sub((decimal_t*)a,(decimal_t*)b,res), 00344 res); 00345 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void print_decimal | ( | const my_decimal * | dec | ) |
Definition at line 201 of file my_decimal.cc.
00202 { 00203 int i, end; 00204 char buff[512], *pos; 00205 pos= buff; 00206 pos+= my_sprintf(buff, (buff, "Decimal: sign: %d intg: %d frac: %d { ", 00207 dec->sign(), dec->intg, dec->frac)); 00208 end= ROUND_UP(dec->frac)+ROUND_UP(dec->intg)-1; 00209 for (i=0; i < end; i++) 00210 pos+= my_sprintf(pos, (pos, "%09d, ", dec->buf[i])); 00211 pos+= my_sprintf(pos, (pos, "%09d }\n", dec->buf[i])); 00212 fputs(buff, DBUG_FILE); 00213 }
| void print_decimal_buff | ( | const my_decimal * | dec, | |
| const byte * | ptr, | |||
| int | length | |||
| ) |
Definition at line 218 of file my_decimal.cc.
00219 { 00220 print_decimal(dec); 00221 fprintf(DBUG_FILE, "Record: "); 00222 for (int i= 0; i < length; i++) 00223 { 00224 fprintf(DBUG_FILE, "%02X ", (uint)((uchar *)ptr)[i]); 00225 } 00226 fprintf(DBUG_FILE, "\n"); 00227 }
| int str2my_decimal | ( | uint | mask, | |
| const char * | from, | |||
| uint | length, | |||
| CHARSET_INFO * | charset, | |||
| my_decimal * | decimal_value | |||
| ) |
Definition at line 159 of file my_decimal.cc.
00161 { 00162 char *end, *from_end; 00163 int err; 00164 char buff[STRING_BUFFER_USUAL_SIZE]; 00165 String tmp(buff, sizeof(buff), &my_charset_bin); 00166 if (charset->mbminlen > 1) 00167 { 00168 uint dummy_errors; 00169 tmp.copy(from, length, charset, &my_charset_latin1, &dummy_errors); 00170 from= tmp.ptr(); 00171 length= tmp.length(); 00172 charset= &my_charset_bin; 00173 } 00174 from_end= end= (char*) from+length; 00175 err= string2decimal((char *)from, (decimal_t*) decimal_value, &end); 00176 if (end != from_end && !err) 00177 { 00178 /* Give warning if there is something other than end space */ 00179 for ( ; end < from_end; end++) 00180 { 00181 if (!my_isspace(&my_charset_latin1, *end)) 00182 { 00183 err= E_DEC_TRUNCATED; 00184 break; 00185 } 00186 } 00187 } 00188 check_result_and_overflow(mask, err, decimal_value); 00189 return err; 00190 }
| int str2my_decimal | ( | uint | mask, | |
| const char * | str, | |||
| my_decimal * | d, | |||
| char ** | end | |||
| ) | [inline] |
Definition at line 282 of file my_decimal.h.
References check_result_and_overflow(), and string2decimal.
00283 { 00284 return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end), 00285 d); 00286 }
Here is the call graph for this function:

1.4.7

