#include <item.h>
Inheritance diagram for Item_decimal:


Public Member Functions | |
| Item_decimal (const char *str_arg, uint length, CHARSET_INFO *charset) | |
| Item_decimal (const char *str, const my_decimal *val_arg, uint decimal_par, uint length) | |
| Item_decimal (my_decimal *value_par) | |
| Item_decimal (longlong val, bool unsig) | |
| Item_decimal (double val, int precision, int scale) | |
| Item_decimal (const char *bin, int precision, int scale) | |
| enum Type | type () const |
| enum Item_result | result_type () const |
| enum_field_types | field_type () const |
| longlong | val_int () |
| double | val_real () |
| String * | val_str (String *) |
| my_decimal * | val_decimal (my_decimal *val) |
| int | save_in_field (Field *field, bool no_conversions) |
| bool | basic_const_item () const |
| Item * | new_item () |
| void | cleanup () |
| void | print (String *str) |
| Item_num * | neg () |
| uint | decimal_precision () const |
| bool | eq (const Item *, bool binary_cmp) const |
| void | set_decimal_value (my_decimal *value_par) |
Protected Attributes | |
| my_decimal | decimal_value |
Definition at line 1569 of file item.h.
| Item_decimal::Item_decimal | ( | const char * | str_arg, | |
| uint | length, | |||
| CHARSET_INFO * | charset | |||
| ) |
Definition at line 1949 of file item.cc.
References charset, decimal_value, Item::decimals, E_DEC_FATAL_ERROR, Item::fixed, st_decimal_t::frac, st_decimal_t::intg, Item::max_length, my_decimal_precision_to_length(), Item::name, str2my_decimal(), and Item::unsigned_flag.
Referenced by new_item().
01951 { 01952 str2my_decimal(E_DEC_FATAL_ERROR, str_arg, length, charset, &decimal_value); 01953 name= (char*) str_arg; 01954 decimals= (uint8) decimal_value.frac; 01955 fixed= 1; 01956 max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, 01957 decimals, unsigned_flag); 01958 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Item_decimal::Item_decimal | ( | const char * | str, | |
| const my_decimal * | val_arg, | |||
| uint | decimal_par, | |||
| uint | length | |||
| ) |
Definition at line 1980 of file item.cc.
References decimal_value, Item::decimals, Item::fixed, Item::max_length, my_decimal2decimal(), and Item::name.
01982 { 01983 my_decimal2decimal(val_arg, &decimal_value); 01984 name= (char*) str; 01985 decimals= (uint8) decimal_par; 01986 max_length= length; 01987 fixed= 1; 01988 }
Here is the call graph for this function:

| Item_decimal::Item_decimal | ( | my_decimal * | value_par | ) |
Definition at line 1991 of file item.cc.
References decimal_value, Item::decimals, Item::fixed, st_decimal_t::frac, st_decimal_t::intg, Item::max_length, my_decimal2decimal(), my_decimal_precision_to_length(), and Item::unsigned_flag.
01992 { 01993 my_decimal2decimal(value_par, &decimal_value); 01994 decimals= (uint8) decimal_value.frac; 01995 fixed= 1; 01996 max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, 01997 decimals, unsigned_flag); 01998 }
Here is the call graph for this function:

Definition at line 1960 of file item.cc.
References decimal_value, Item::decimals, E_DEC_FATAL_ERROR, Item::fixed, st_decimal_t::frac, int2my_decimal(), st_decimal_t::intg, Item::max_length, my_decimal_precision_to_length(), and Item::unsigned_flag.
01961 { 01962 int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value); 01963 decimals= (uint8) decimal_value.frac; 01964 fixed= 1; 01965 max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, 01966 decimals, unsigned_flag); 01967 }
Here is the call graph for this function:

| Item_decimal::Item_decimal | ( | double | val, | |
| int | precision, | |||
| int | scale | |||
| ) |
Definition at line 1970 of file item.cc.
References decimal_value, Item::decimals, double2my_decimal(), E_DEC_FATAL_ERROR, Item::fixed, st_decimal_t::frac, st_decimal_t::intg, Item::max_length, my_decimal_precision_to_length(), and Item::unsigned_flag.
01971 { 01972 double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value); 01973 decimals= (uint8) decimal_value.frac; 01974 fixed= 1; 01975 max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, 01976 decimals, unsigned_flag); 01977 }
Here is the call graph for this function:

| Item_decimal::Item_decimal | ( | const char * | bin, | |
| int | precision, | |||
| int | scale | |||
| ) |
Definition at line 2001 of file item.cc.
References binary2my_decimal(), decimal_value, Item::decimals, E_DEC_FATAL_ERROR, Item::fixed, st_decimal_t::frac, Item::max_length, my_decimal_precision_to_length(), and Item::unsigned_flag.
02002 { 02003 binary2my_decimal(E_DEC_FATAL_ERROR, bin, 02004 &decimal_value, precision, scale); 02005 decimals= (uint8) decimal_value.frac; 02006 fixed= 1; 02007 max_length= my_decimal_precision_to_length(precision, decimals, 02008 unsigned_flag); 02009 }
Here is the call graph for this function:

| bool Item_decimal::basic_const_item | ( | ) | const [inline, virtual] |
| void Item_decimal::cleanup | ( | ) | [inline, virtual] |
| uint Item_decimal::decimal_precision | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1604 of file item.h.
References decimal_value, and my_decimal::precision().
01604 { return decimal_value.precision(); }
Here is the call graph for this function:

Reimplemented from Item.
Definition at line 2040 of file item.cc.
References Item::basic_const_item(), decimal_value, my_decimal_cmp(), Item::type(), type(), and value.
02041 { 02042 if (type() == item->type() && item->basic_const_item()) 02043 { 02044 /* 02045 We need to cast off const to call val_decimal(). This should 02046 be OK for a basic constant. Additionally, we can pass 0 as 02047 a true decimal constant will return its internal decimal 02048 storage and ignore the argument. 02049 */ 02050 Item *arg= (Item*) item; 02051 my_decimal *value= arg->val_decimal(0); 02052 return !my_decimal_cmp(&decimal_value, value); 02053 } 02054 return 0; 02055 }
Here is the call graph for this function:

| enum_field_types Item_decimal::field_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1584 of file item.h.
References MYSQL_TYPE_NEWDECIMAL.
01584 { return MYSQL_TYPE_NEWDECIMAL; }
| Item_num* Item_decimal::neg | ( | ) | [inline, virtual] |
Implements Item_num.
Definition at line 1598 of file item.h.
References decimal_value, my_decimal_neg(), my_decimal::sign(), and Item::unsigned_flag.
Referenced by Item_uint::neg().
01599 { 01600 my_decimal_neg(&decimal_value); 01601 unsigned_flag= !decimal_value.sign(); 01602 return this; 01603 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Item* Item_decimal::new_item | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 1591 of file item.h.
References decimal_value, Item::decimals, Item_decimal(), Item::max_length, and Item::name.
01592 { 01593 return new Item_decimal(name, &decimal_value, decimals, max_length); 01594 }
Here is the call graph for this function:

| void Item_decimal::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item.
Definition at line 2033 of file item.cc.
References String::append(), decimal_value, E_DEC_FATAL_ERROR, my_decimal2string(), and Item::str_value.
02034 { 02035 my_decimal2string(E_DEC_FATAL_ERROR, &decimal_value, 0, 0, 0, &str_value); 02036 str->append(str_value); 02037 }
Here is the call graph for this function:

| enum Item_result Item_decimal::result_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 1583 of file item.h.
References DECIMAL_RESULT.
01583 { return DECIMAL_RESULT; }
Reimplemented from Item.
Definition at line 4256 of file item.cc.
References decimal_value, Field::set_notnull(), and Field::store_decimal().
04257 { 04258 field->set_notnull(); 04259 return field->store_decimal(&decimal_value); 04260 }
Here is the call graph for this function:

| void Item_decimal::set_decimal_value | ( | my_decimal * | value_par | ) |
Definition at line 2058 of file item.cc.
References decimal_value, Item::decimals, st_decimal_t::frac, st_decimal_t::intg, Item::max_length, my_decimal2decimal(), my_decimal_precision_to_length(), my_decimal::sign(), and Item::unsigned_flag.
Referenced by in_decimal::value_to_item().
02059 { 02060 my_decimal2decimal(value_par, &decimal_value); 02061 decimals= (uint8) decimal_value.frac; 02062 unsigned_flag= !decimal_value.sign(); 02063 max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, 02064 decimals, unsigned_flag); 02065 }
Here is the call graph for this function:

Here is the caller graph for this function:

| enum Type Item_decimal::type | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 1582 of file item.h.
References Item::DECIMAL_ITEM.
Referenced by eq().
01582 { return DECIMAL_ITEM; }
Here is the caller graph for this function:

| my_decimal* Item_decimal::val_decimal | ( | my_decimal * | val | ) | [inline, virtual] |
Implements Item.
Definition at line 1588 of file item.h.
References decimal_value.
01588 { return &decimal_value; }
| longlong Item_decimal::val_int | ( | ) | [virtual] |
Implements Item.
Definition at line 2012 of file item.cc.
References decimal_value, E_DEC_FATAL_ERROR, my_decimal2int(), and Item::unsigned_flag.
02013 { 02014 longlong result; 02015 my_decimal2int(E_DEC_FATAL_ERROR, &decimal_value, unsigned_flag, &result); 02016 return result; 02017 }
Here is the call graph for this function:

| double Item_decimal::val_real | ( | ) | [virtual] |
Implements Item.
Definition at line 2019 of file item.cc.
References decimal_value, E_DEC_FATAL_ERROR, and my_decimal2double().
02020 { 02021 double result; 02022 my_decimal2double(E_DEC_FATAL_ERROR, &decimal_value, &result); 02023 return result; 02024 }
Here is the call graph for this function:

Implements Item.
Definition at line 2026 of file item.cc.
References decimal_value, E_DEC_FATAL_ERROR, my_charset_bin, my_decimal2string(), and String::set_charset().
02027 { 02028 result->set_charset(&my_charset_bin); 02029 my_decimal2string(E_DEC_FATAL_ERROR, &decimal_value, 0, 0, 0, result); 02030 return result; 02031 }
Here is the call graph for this function:

my_decimal Item_decimal::decimal_value [protected] |
Definition at line 1572 of file item.h.
Referenced by decimal_precision(), eq(), Item_decimal(), neg(), new_item(), print(), save_in_field(), set_decimal_value(), val_decimal(), val_int(), val_real(), and val_str().
1.4.7

