My Project
|
Public Member Functions | |
Field_new_decimal (uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg) | |
Field_new_decimal (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, uint8 dec_arg, bool unsigned_arg) | |
enum_field_types | type () const |
enum ha_base_keytype | key_type () const |
Item_result | result_type () const |
type_conversion_status | reset (void) |
type_conversion_status | store_value (const my_decimal *decimal_value) |
void | set_value_on_overflow (my_decimal *decimal_value, bool sign) |
type_conversion_status | store (const char *to, uint length, const CHARSET_INFO *charset) |
type_conversion_status | store (double nr) |
type_conversion_status | store (longlong nr, bool unsigned_val) |
type_conversion_status | store_time (MYSQL_TIME *ltime, uint8 dec) |
type_conversion_status | store_decimal (const my_decimal *) |
double | val_real (void) |
longlong | val_int (void) |
my_decimal * | val_decimal (my_decimal *) |
bool | get_date (MYSQL_TIME *ltime, uint fuzzydate) |
bool | get_time (MYSQL_TIME *ltime) |
String * | val_str (String *, String *) |
int | cmp (const uchar *, const uchar *) |
void | make_sort_key (uchar *buff, uint length) |
bool | zero_pack () const |
void | sql_type (String &str) const |
uint32 | max_display_length () |
uint32 | pack_length () const |
uint | pack_length_from_metadata (uint field_metadata) |
uint | row_pack_length () const |
bool | compatible_field_size (uint field_metadata, Relay_log_info *rli, uint16 mflags, int *order_var) |
uint | is_equal (Create_field *new_field) |
Field_new_decimal * | clone (MEM_ROOT *mem_root) const |
Field_new_decimal * | clone () const |
virtual const uchar * | unpack (uchar *to, const uchar *from, uint param_data, bool low_byte_first) |
Static Public Member Functions | |
static Field * | create_from_item (Item *) |
Public Attributes | |
uint | precision |
uint | bin_size |
Field_new_decimal* Field_new_decimal::clone | ( | MEM_ROOT * | mem_root | ) | const [inline, virtual] |
Makes a shallow copy of the Field object.
mem_root | MEM_ROOT to use for memory allocation. |
NULL | If memory allocation failed. |
Implements Field.
Field_new_decimal* Field_new_decimal::clone | ( | ) | const [inline, virtual] |
Makes a shallow copy of the Field object.
NULL | If memory allocation failed. |
Implements Field.
bool Field_new_decimal::compatible_field_size | ( | uint | field_metadata, |
Relay_log_info * | rli, | ||
uint16 | mflags, | ||
int * | order_var | ||
) | [virtual] |
Check to see if field size is compatible with destination.
This method is used in row-based replication to verify that the slave's field size is less than or equal to the master's field size. The encoded field metadata (from the master or source) is decoded and compared to the size of this field (the slave or destination).
field_metadata | Encoded size in field metadata |
order_var | Pointer to variable where the order between the source field and this field will be returned. |
true
Reimplemented from Field.
uint Field_new_decimal::is_equal | ( | Create_field * | new_field | ) | [virtual] |
Check whether two numeric fields can be considered 'equal' for table alteration purposes. Fields are equal if they are of the same type and retain the same pack length.
Reimplemented from Field_num.
void Field_new_decimal::make_sort_key | ( | uchar * | buff, |
uint | length | ||
) | [virtual] |
Writes a copy of the current value in the record buffer, suitable for sorting using byte-by-byte comparison. Integers are always in big-endian regardless of hardware architecture. At most length bytes are written into the buffer.
buff | The buffer, assumed to be at least length bytes. |
length | Number of bytes to write. |
Implements Field.
uint Field_new_decimal::pack_length_from_metadata | ( | uint | field_metadata | ) | [virtual] |
Returns the number of bytes field uses in row-based replication row packed size.
This method is used in row-based replication to determine the number of bytes that the field consumes in the row record format. This is used to skip fields in the master that do not exist on the slave.
field_metadata | Encoded size in field metadata |
Reimplemented from Field_num.
void Field_new_decimal::set_value_on_overflow | ( | my_decimal * | decimal_value, |
bool | sign | ||
) |
Generate max/min decimal value in case of overflow.
decimal_value | buffer for value |
sign | sign of value which caused overflow |
type_conversion_status Field_new_decimal::store | ( | double | nr | ) | [virtual] |
type_conversion_status Field_new_decimal::store_decimal | ( | const my_decimal * | val | ) | [virtual] |
Storing decimal in integer fields.
val | value for storing |
TYPE_OK | Storage of value went fine without warnings or errors |
!TYPE_OK | Warning/error as indicated by type_conversion_status enum value |
Reimplemented from Field_num.
type_conversion_status Field_new_decimal::store_time | ( | MYSQL_TIME * | ltime, |
uint8 | dec_arg | ||
) | [virtual] |
Store MYSQL_TIME value with the given amount of decimal digits into a field.
Note, the "dec" parameter represents number of digits of the Item that previously created the MYSQL_TIME value. It's needed when we store the value into a CHAR/VARCHAR/TEXT field to display the proper amount of fractional digits. For other field types the "dec" value does not matter and is ignored.
ltime | Time, date or datetime value. |
dec | Number of decimals in ltime. |
false | on success |
true | on error |
This is called when storing a date in a string.
Reimplemented from Field_num.
type_conversion_status Field_new_decimal::store_value | ( | const my_decimal * | decimal_value | ) |
Store decimal value in the binary buffer.
Checks if decimal_value fits into field size. If it does, stores the decimal in the buffer using binary format. Otherwise sets maximal number that can be stored in the field.
decimal_value | my_decimal |
0 | ok |
1 | error |
const uchar * Field_new_decimal::unpack | ( | uchar * | to, |
const uchar * | from, | ||
uint | param_data, | ||
bool | low_byte_first | ||
) | [virtual] |
Unpack a decimal field from row data.
This method is used to unpack a decimal or numeric field from a master whose size of the field is less than that of the slave.
to | Destination of the data |
from | Source of the data |
param_data | Precision (upper) and decimal (lower) values |
Reimplemented from Field.
my_decimal * Field_new_decimal::val_decimal | ( | my_decimal * | decimal_value | ) | [virtual] |
Return decimal value of integer field.
decimal_value | buffer for storing decimal value |
Reimplemented from Field_num.