My Project
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
Field_blob Class Reference
Inheritance diagram for Field_blob:
Field_longstr Field_str Field

List of all members.

Public Member Functions

 Field_blob (uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, TABLE_SHARE *share, uint blob_pack_length, const CHARSET_INFO *cs)
 Field_blob (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, const CHARSET_INFO *cs)
 Field_blob (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, const CHARSET_INFO *cs, bool set_packlength)
 Field_blob (uint32 packlength_arg)
enum_field_types type () const
bool match_collation_to_optimize_range () const
enum ha_base_keytype key_type () const
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)
double val_real (void)
longlong val_int (void)
Stringval_str (String *, String *)
my_decimalval_decimal (my_decimal *)
int cmp_max (const uchar *, const uchar *, uint max_length)
int cmp (const uchar *a, const uchar *b)
int cmp (const uchar *a, uint32 a_length, const uchar *b, uint32 b_length)
int cmp_binary (const uchar *a, const uchar *b, uint32 max_length=~0L)
int key_cmp (const uchar *, const uchar *)
int key_cmp (const uchar *str, uint length)
uint32 key_length () const
void make_sort_key (uchar *buff, uint length)
uint32 pack_length () const
uint32 pack_length_no_ptr () const
uint row_pack_length () const
uint32 sort_length () const
virtual uint32 max_data_length () const
type_conversion_status reset (void)
void reset_fields ()
uint32 get_field_buffer_size (void)
void store_length (uchar *i_ptr, uint i_packlength, uint32 i_number)
void store_length (uint32 number)
uint32 get_length (uint row_offset=0)
uint32 get_length (const uchar *ptr, uint packlength, bool low_byte_first)
uint32 get_length (const uchar *ptr_arg)
void put_length (uchar *pos, uint32 length)
void get_ptr (uchar **str)
void get_ptr (uchar **str, uint row_offset)
void set_ptr (uchar *length, uchar *data)
void set_ptr_offset (my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
void set_ptr (uint32 length, uchar *data)
uint get_key_image (uchar *buff, uint length, imagetype type)
void set_key_image (const uchar *buff, uint length)
void sql_type (String &str) const
bool copy ()
Field_blobclone (MEM_ROOT *mem_root) const
Field_blobclone () 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 packed_col_length (const uchar *col_ptr, uint length)
uint max_packed_col_length (uint max_length)
void free ()
void clear_temporary ()
bool has_charset (void) const
uint32 max_display_length ()
uint32 char_length ()
uint is_equal (Create_field *new_field)
bool in_read_set ()
bool in_write_set ()

Static Public Member Functions

static void store_length (uchar *i_ptr, uint i_packlength, uint32 i_number, bool low_byte_first)

Protected Member Functions

void store_ptr_and_length (const char *from, uint32 length)

Protected Attributes

uint packlength
String value


type_conversion_status field_conv (Field *to, Field *from)

Member Function Documentation

uint32 Field_blob::char_length ( ) [virtual]

maximum possible character length for blob.

This method is used in Item_field::set_field to calculate max_length for Item.

For example: CREATE TABLE t2 SELECT CONCAT(tinyblob_utf8_column) FROM t1; must create a "VARCHAR(255) CHARACTER SET utf8" column.


Reimplemented from Field.

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

Makes a shallow copy of the Field object.

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.
mem_rootMEM_ROOT to use for memory allocation.
Return values:
NULLIf memory allocation failed.

Implements Field.

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

Makes a shallow copy of the Field object.

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.

uint Field_blob::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_str.

void Field_blob::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.

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

Implements Field.

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

Get the maximum size of the data in packed format.

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

Reimplemented from Field_longstr.

uint32 Field_blob::max_display_length ( ) [virtual]

maximum possible display length for blob.


Reimplemented from Field_str.

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

uint32 Field_blob::pack_length_no_ptr ( ) const [inline]

Return the packed length without the pointer size added.

This is used to determine the size of the actual data in the row buffer.

The length of the raw data itself without the pointer.
void Field_blob::put_length ( uchar *  pos,
uint32  length 

Put a blob length field into a record buffer.

Depending on the maximum length of a blob, its length field is put into 1 to 4 bytes. This is a property of the blob object, described by 'packlength'.

posPointer into the record buffer.
lengthThe length value to put.
type_conversion_status Field_blob::store ( double  nr) [virtual]

Store double value in Field_string or Field_varstring.

Pretty prints double number into field_length characters buffer.


Reimplemented from Field_str.

void Field_blob::store_ptr_and_length ( const char *  from,
uint32  length 
) [inline, protected]

Store ptr and length.

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

Unpack a blob field from row data.

This method is used to unpack a blob field from a master whose size of the field is less than that of the slave. Note: This method is included to satisfy inheritance rules, but is not needed for blob fields. It simply is used as a pass-through to the original unpack() method for blob fields.

toDestination of the data
fromSource of the data
param_dataTRUE if base types should be stored in little- endian format, FALSE if native format should be used.
New pointer into memory based on from + length of the data

Reimplemented from Field.

Friends And Related Function Documentation

type_conversion_status field_conv ( Field to,
Field from 
) [friend]

Simple quick field convert that is called on insert.

Member Data Documentation

uint Field_blob::packlength [protected]

The number of bytes used to represent the length of the blob.

The 'value'-object is a cache fronting the storage engine.

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