My Project
|
Public Member Functions | |
Field_string (uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, const CHARSET_INFO *cs) | |
Field_string (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, const CHARSET_INFO *cs) | |
enum_field_types | type () const |
bool | match_collation_to_optimize_range () const |
enum ha_base_keytype | key_type () const |
bool | zero_pack () const |
type_conversion_status | reset (void) |
type_conversion_status | store (const char *to, uint length, const CHARSET_INFO *charset) |
type_conversion_status | store (longlong nr, bool unsigned_val) |
type_conversion_status | store (double nr) |
double | val_real (void) |
longlong | val_int (void) |
String * | val_str (String *, String *) |
my_decimal * | val_decimal (my_decimal *) |
int | cmp (const uchar *, const uchar *) |
void | make_sort_key (uchar *buff, uint length) |
void | sql_type (String &str) const |
virtual uchar * | pack (uchar *to, const uchar *from, uint max_length, bool low_byte_first) |
virtual const uchar * | unpack (uchar *to, const uchar *from, uint param_data, bool low_byte_first) |
uint | pack_length_from_metadata (uint field_metadata) |
bool | compatible_field_size (uint field_metadata, Relay_log_info *rli, uint16 mflags, int *order_var) |
uint | row_pack_length () const |
int | pack_cmp (const uchar *a, const uchar *b, uint key_length, my_bool insert_or_update) |
int | pack_cmp (const uchar *b, uint key_length, my_bool insert_or_update) |
uint | packed_col_length (const uchar *to, uint length) |
uint | max_packed_col_length (uint max_length) |
enum_field_types | real_type () const |
bool | has_charset (void) const |
Field * | new_field (MEM_ROOT *root, TABLE *new_table, bool keep_type) |
Field_string * | clone (MEM_ROOT *mem_root) const |
Field_string * | clone () const |
virtual uint | get_key_image (uchar *buff, uint length, imagetype type) |
Public Attributes | |
bool | can_alter_field_type |
Field_string* Field_string::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_string* Field_string::clone | ( | ) | const [inline, virtual] |
Makes a shallow copy of the Field object.
NULL | If memory allocation failed. |
Implements Field.
bool Field_string::compatible_field_size | ( | uint | metadata, |
Relay_log_info * | rli, | ||
uint16 | mflags, | ||
int * | order | ||
) | [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).
The comparison is made so that if the source data (from the master) is less than the target data (on the slave), -1 is returned in
. This implies that a conversion is necessary, but that it is lossy and can result in truncation of the value.*order_var
If the source data is strictly greater than the target data, 1 is returned in *order_var
. This implies that the source type can is contained in the target type and that a conversion is necessary but is non-lossy.
If no conversion is required to fit the source type in the target type, 0 is returned in *order_var
.
field_metadata | Encoded size in field metadata |
mflags | Flags from the table map event for the table. |
order_var | Pointer to variable where the order between the source field and this field will be returned. |
true
if this field's size is compatible with the master's field size, false
otherwise. Reimplemented from Field.
void Field_string::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.
uchar * Field_string::pack | ( | uchar * | to, |
const uchar * | from, | ||
uint | max_length, | ||
bool | low_byte_first | ||
) | [virtual] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Reimplemented from Field.
type_conversion_status Field_string::store | ( | double | nr | ) | [inline, virtual] |
Store double value in Field_string or Field_varstring.
Pretty prints double number into field_length characters buffer.
nr | number |
Reimplemented from Field_str.
const uchar * Field_string::unpack | ( | uchar * | to, |
const uchar * | from, | ||
uint | param_data, | ||
bool | low_byte_first | ||
) | [virtual] |
Unpack a string field from row data.
This method is used to unpack a string field from a master whose size of the field is less than that of the slave. Note that there can be a variety of field types represented with this class. Certain types like ENUM or SET are processed differently. Hence, the upper byte of the param_data
argument contains the result of field->real_type() from the master.
Field_string::do_save_field_metadata
to | Destination of the data |
from | Source of the data |
param_data | Real type (upper) and length (lower) values |
Reimplemented from Field.