My Project
|
Public Member Functions | |
Field_num (uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, const char *field_name_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg) | |
Item_result | result_type () const |
enum Derivation | derivation (void) const |
uint | repertoire (void) const |
const CHARSET_INFO * | charset (void) const |
void | prepend_zeros (String *value) |
void | add_zerofill_and_unsigned (String &res) const |
uint | decimals () const |
bool | eq_def (Field *field) |
type_conversion_status | store_decimal (const my_decimal *) |
type_conversion_status | store_time (MYSQL_TIME *ltime, uint8 dec) |
my_decimal * | val_decimal (my_decimal *) |
bool | get_date (MYSQL_TIME *ltime, uint fuzzydate) |
bool | get_time (MYSQL_TIME *ltime) |
uint | is_equal (Create_field *new_field) |
uint | row_pack_length () const |
uint32 | pack_length_from_metadata (uint field_metadata) |
type_conversion_status | check_int (const CHARSET_INFO *cs, const char *str, int length, const char *int_end, int error) |
type_conversion_status | get_int (const CHARSET_INFO *cs, const char *from, uint len, longlong *rnd, ulonglong unsigned_max, longlong signed_min, longlong signed_max) |
Public Attributes | |
const uint8 | dec |
bool | zerofill |
bool | unsigned_flag |
Friends | |
class | Create_field |
Field_num::Field_num | ( | uchar * | ptr_arg, |
uint32 | len_arg, | ||
uchar * | null_ptr_arg, | ||
uchar | null_bit_arg, | ||
utype | unireg_check_arg, | ||
const char * | field_name_arg, | ||
uint8 | dec_arg, | ||
bool | zero_arg, | ||
bool | unsigned_arg | ||
) |
Numeric fields base class constructor.
type_conversion_status Field_num::check_int | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
int | length, | ||
const char * | int_end, | ||
int | error | ||
) |
Test if given number is a int.
str | String to test |
length | Length of 'str' |
int_end | Pointer to char after last used digit |
cs | Character set |
bool Field_num::eq_def | ( | Field * | field | ) | [virtual] |
Reimplemented from Field.
uint Field_num::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.
Reimplemented in Field_new_decimal.
type_conversion_status Field_num::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 |
Implements Field.
Reimplemented in Field_new_decimal, and Field_real.
type_conversion_status Field_num::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.
Reimplemented in Field_year, Field_new_decimal, and Field_real.
my_decimal * Field_num::val_decimal | ( | my_decimal * | decimal_value | ) | [virtual] |
Return decimal value of integer field.
decimal_value | buffer for storing decimal value |
Implements Field.
Reimplemented in Field_new_decimal, and Field_real.