My Project
Public Member Functions | Public Attributes
Field_bit Class Reference
Inheritance diagram for Field_bit:
Field Field_bit_as_char

List of all members.

Public Member Functions

 Field_bit (uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg, enum utype unireg_check_arg, const char *field_name_arg)
enum_field_types type () const
enum ha_base_keytype key_type () const
uint32 key_length () const
uint32 max_data_length () const
uint32 max_display_length ()
Item_result result_type () const
type_conversion_status reset (void)
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_decimal (const my_decimal *)
double val_real (void)
longlong val_int (void)
Stringval_str (String *, String *)
virtual bool str_needs_quotes ()
my_decimalval_decimal (my_decimal *)
int cmp (const uchar *a, const uchar *b)
int cmp_binary_offset (uint row_offset)
int cmp_max (const uchar *a, const uchar *b, uint max_length)
int key_cmp (const uchar *a, const uchar *b)
int key_cmp (const uchar *str, uint length)
int cmp_offset (uint row_offset)
void get_image (uchar *buff, uint length, const CHARSET_INFO *cs)
void set_image (const uchar *buff, uint length, const CHARSET_INFO *cs)
uint get_key_image (uchar *buff, uint length, imagetype type)
void set_key_image (const uchar *buff, uint length)
void make_sort_key (uchar *buff, uint length)
uint32 pack_length () const
uint32 pack_length_in_rec () const
uint pack_length_from_metadata (uint field_metadata)
uint row_pack_length () const
bool compatible_field_size (uint metadata, Relay_log_info *rli, uint16 mflags, int *order_var)
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)
virtual void set_default ()
Fieldnew_key_field (MEM_ROOT *root, TABLE *new_table, uchar *new_ptr, uchar *new_null_ptr, uint new_null_bit)
void set_bit_ptr (uchar *bit_ptr_arg, uchar bit_ofs_arg)
bool eq (Field *field)
uint is_equal (Create_field *new_field)
void move_field_offset (my_ptrdiff_t ptr_diff)
void hash (ulong *nr, ulong *nr2)
Field_bitclone (MEM_ROOT *mem_root) const
Field_bitclone () const

Public Attributes

uchar * bit_ptr
uchar bit_ofs
uint bit_len
uint bytes_in_rec

Member Function Documentation

Field_bit* Field_bit::clone ( MEM_ROOT *  mem_root) const [inline, virtual]

Makes a shallow copy of the Field object.

Note:
This member function must be overridden in all concrete subclasses. Several of the Field subclasses are concrete even though they are not leaf classes, so the compiler will not always catch this.
Parameters:
mem_rootMEM_ROOT to use for memory allocation.
Return values:
NULLIf memory allocation failed.

Implements Field.

Reimplemented in Field_bit_as_char.

Field_bit* Field_bit::clone ( ) const [inline, virtual]

Makes a shallow copy of the Field object.

Note:
This member function must be overridden in all concrete subclasses. Several of the Field subclasses are concrete even though they are not leaf classes, so the compiler will not always catch this.
Return values:
NULLIf memory allocation failed.

Implements Field.

Reimplemented in Field_bit_as_char.

bool Field_bit::compatible_field_size ( uint  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).

Parameters:
field_metadataEncoded size in field metadata
order_varPointer to variable where the order between the source field and this field will be returned.
Returns:
true

Reimplemented from Field.

uint Field_bit::is_equal ( Create_field new_field) [virtual]

Whether a field being created is compatible with a existing one.

Used by the ALTER TABLE code to evaluate whether the new definition of a table is compatible with the old definition so that it can determine if data needs to be copied over (table data change).

Reimplemented from Field.

void Field_bit::make_sort_key ( uchar *  buff,
uint  length 
) [inline, 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.

Parameters:
buffThe buffer, assumed to be at least length bytes.
lengthNumber of bytes to write.

Implements Field.

uint32 Field_bit::max_data_length ( ) const [inline, virtual]

Get the maximum size of the data in packed format.

Returns:
Maximum data length of the field when packed using the Field::pack() function.

Reimplemented from Field.

uchar * Field_bit::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.

uint Field_bit::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.

Parameters:
field_metadataEncoded size in field metadata
Returns:
The size of the field based on the field metadata.

Reimplemented from Field.

const uchar * Field_bit::unpack ( uchar *  to,
const uchar *  from,
uint  param_data,
bool  low_byte_first 
) [virtual]

Unpack a bit field from row data.

This method is used to unpack a bit field from a master whose size of the field is less than that of the slave.

Parameters:
toDestination of the data
fromSource of the data
param_dataBit length (upper) and length (lower) values
Returns:
New pointer into memory based on from + length of the data

Reimplemented from Field.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines