|
drizzle
C++ MySQL-protocol-compatible database server
|
Public Member Functions | |
| Field_varstring (unsigned char *ptr_arg, uint32_t len_arg, uint32_t length_bytes_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, const char *field_name_arg, const charset_info_st *const cs) | |
| Field_varstring (uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg, const charset_info_st *const cs) | |
| enum_field_types | type () const |
| enum ha_base_keytype | key_type () const |
| bool | zero_pack () const |
| int | reset (void) |
| uint32_t | pack_length () const |
| uint32_t | pack_length_no_ptr () const |
| uint32_t | key_length () const |
| uint32_t | sort_length () const |
| int | store (const char *to, uint32_t length, const charset_info_st *const charset) |
| int | store (int64_t nr, bool unsigned_val) |
| int | store (double nr) |
| double | val_real (void) const |
| int64_t | val_int (void) const |
| String * | val_str (String *, String *) const |
| String * | val_str (String *str) |
| type::Decimal * | val_decimal (type::Decimal *) const |
| int | cmp_max (const unsigned char *, const unsigned char *, uint32_t max_length) |
| int | cmp (const unsigned char *str) |
| int | cmp (const unsigned char *a, const unsigned char *b) |
| void | sort_string (unsigned char *buff, uint32_t length) |
| uint32_t | get_key_image (unsigned char *buff, uint32_t length) |
| uint32_t | get_key_image (std::basic_string< unsigned char > &buff, uint32_t length) |
| void | set_key_image (const unsigned char *buff, uint32_t length) |
| virtual unsigned char * | pack (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| virtual const unsigned char * | unpack (unsigned char *to, const unsigned char *from, uint32_t param_data, bool low_byte_first) |
| int | cmp_binary (const unsigned char *a, const unsigned char *b, uint32_t max_length=UINT32_MAX) |
| int | key_cmp (const unsigned char *, const unsigned char *) |
| int | key_cmp (const unsigned char *str, uint32_t length) |
| uint32_t | max_packed_col_length (uint32_t max_length) |
| uint32_t | used_length () |
| uint32_t | size_of () const |
| enum_field_types | real_type () const |
| bool | has_charset (void) const |
| Field * | new_field (memory::Root *root, Table *new_table, bool keep_type) |
| Field * | new_key_field (memory::Root *root, Table *new_table, unsigned char *new_ptr, unsigned char *new_null_ptr, uint32_t new_null_bit) |
| unsigned char * | pack (unsigned char *to, const unsigned char *from) |
| const unsigned char * | unpack (unsigned char *to, const unsigned char *from) |
| Public Member Functions inherited from drizzled::Field_str | |
| Field_str (unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, const char *field_name_arg, const charset_info_st *const charset) | |
| Item_result | result_type () const |
| uint32_t | decimals () const |
| int | store_decimal (const type::Decimal *) |
| const charset_info_st * | charset (void) const |
| void | set_charset (const charset_info_st *const charset_arg) |
| enum Derivation | derivation (void) const |
| virtual void | set_derivation (enum Derivation derivation_arg) |
| bool | binary () const |
| uint32_t | max_display_length () |
| virtual bool | str_needs_quotes () |
| uint32_t | max_data_length () const |
| Public Member Functions inherited from drizzled::Field | |
| Table * | getTable () |
| Table * | getTable () const |
| void | setTable (Table *table_arg) |
| bool | isUnsigned () const |
| uint16_t | position () const |
| void | setPosition (uint32_t arg) |
| Field (unsigned char *ptr_arg, uint32_t length_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, utype unireg_check_arg, const char *field_name_arg) | |
| This is used as a table name when the table structure is not set up. | |
| bool | hasDefault () const |
| int | store_and_check (enum_check_fields check_level, const char *to, uint32_t length, const charset_info_st *const cs) |
| virtual int | store_time (type::Time <ime, type::timestamp_t t_type) |
| String * | val_str_internal (String *str) const |
| virtual Item_result | cmp_type () const |
| virtual Item_result | cast_to_int_type () const |
| virtual bool | eq (Field *field) |
| virtual bool | eq_def (Field *field) |
| virtual bool | is_timestamp () const |
| virtual uint32_t | pack_length_in_rec () const |
| virtual uint32_t | data_length () |
| virtual void | reset_fields () |
| virtual void | set_default () |
| int | cmp_internal (const unsigned char *str) |
| virtual int | cmp_offset (uint32_t row_offset) |
| virtual int | cmp_binary_offset (uint32_t row_offset) |
| bool | is_null (ptrdiff_t row_offset=0) const |
| bool | is_real_null (ptrdiff_t row_offset=0) const |
| bool | is_null_in_record (const unsigned char *record) const |
| bool | is_null_in_record_with_offset (ptrdiff_t offset) const |
| void | set_null (ptrdiff_t row_offset=0) |
| void | set_notnull (ptrdiff_t row_offset=0) |
| bool | maybe_null (void) const |
| bool | real_maybe_null (void) const |
| virtual void | make_field (SendField *) |
| virtual bool | optimize_range (uint32_t idx, uint32_t part) |
| virtual bool | can_be_compared_as_int64_t () const |
| virtual void | free () |
| Field * | clone (memory::Root *, Table *) |
| void | move_field (unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg) |
| void | move_field (unsigned char *ptr_arg) |
| virtual void | move_field_offset (ptrdiff_t ptr_diff) |
| virtual void | get_image (unsigned char *buff, uint32_t length, const charset_info_st *const) |
| virtual void | get_image (std::basic_string< unsigned char > &buff, uint32_t length, const charset_info_st *const) |
| virtual void | set_image (const unsigned char *buff, uint32_t length, const charset_info_st *const) |
| int64_t | val_int_offset (uint32_t row_offset) |
| int64_t | val_int_internal (const unsigned char *new_ptr) |
| String * | val_str_internal (String *str, const unsigned char *new_ptr) |
| unsigned char * | pack (unsigned char *to, const unsigned char *from) |
| const unsigned char * | unpack (unsigned char *to, const unsigned char *from) |
| virtual unsigned char * | pack_key (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| virtual const unsigned char * | unpack_key (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| uint32_t | offset (const unsigned char *record) |
| void | copy_from_tmp (int offset) |
| uint32_t | fill_cache_field (CacheField *copy) |
| virtual bool | get_date (type::Time <ime, uint32_t fuzzydate) const |
| virtual bool | get_time (type::Time <ime) const |
| virtual const charset_info_st * | sort_charset (void) const |
| bool | set_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, const char *str, uint32_t str_len, type::timestamp_t ts_type, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, int64_t nr, type::timestamp_t ts_type, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, const drizzled::error_t code, double nr, type::timestamp_t ts_type) |
| bool | check_overflow (int op_result) |
| int | warn_if_overflow (int op_result) |
| void | init (Table *table_arg) |
| virtual uint32_t | is_equal (CreateField *new_field) |
| int64_t | convert_decimal2int64_t (const type::Decimal *val, bool unsigned_flag, int *err) |
| uint32_t | char_length () const |
| enum column_format_type | column_format () const |
| virtual void | hash (uint32_t *nr, uint32_t *nr2) const |
| bool | isReadSet () const |
| bool | isWriteSet () |
| void | setReadSet (bool arg=true) |
| void | setWriteSet (bool arg=true) |
Static Public Attributes | |
| static const uint32_t | MAX_SIZE = UINT16_MAX |
Private Attributes | |
| uint32_t | length_bytes |
Additional Inherited Members | |
| Public Types inherited from drizzled::Field | |
| enum | utype { NONE , NEXT_NUMBER , TIMESTAMP_OLD_FIELD , TIMESTAMP_DN_FIELD , TIMESTAMP_UN_FIELD , TIMESTAMP_DNUN_FIELD } |
| Static Public Member Functions inherited from drizzled::Field | |
| static void * | operator new (size_t size) |
| static void * | operator new (size_t size, memory::Root *mem_root) |
| static void | operator delete (void *, size_t) |
| static void | operator delete (void *, memory::Root *) |
| static bool | type_can_have_key_part (enum_field_types) |
| static enum_field_types | field_type_merge (enum_field_types, enum_field_types) |
| static Item_result | result_merge_type (enum_field_types) |
| Public Attributes inherited from drizzled::Field | |
| unsigned char * | ptr |
| unsigned char * | null_ptr |
| Table * | orig_table |
| const char * | field_name |
| str_ref | comment |
| key_map | key_start |
| key_map | part_of_key |
| key_map | part_of_key_not_clustered |
| key_map | part_of_sortkey |
| utype | unireg_check |
| uint32_t | field_length |
| uint32_t | flags |
| unsigned char | null_bit |
| bool | is_created_from_null_item |
| Protected Member Functions inherited from drizzled::Field_str | |
| int | report_if_important_data (const char *ptr, const char *end) |
| Protected Member Functions inherited from drizzled::Field | |
| void | pack_num (uint64_t arg, unsigned char *destination=NULL) |
| void | pack_num (uint32_t arg, unsigned char *destination=NULL) |
| uint64_t | unpack_num (uint64_t &destination, const unsigned char *arg=NULL) const |
| uint32_t | unpack_num (uint32_t &destination, const unsigned char *arg=NULL) const |
| Protected Attributes inherited from drizzled::Field_str | |
| const charset_info_st * | field_charset |
| enum Derivation | field_derivation |
Definition at line 29 of file varstring.h.
| drizzled::Field_varstring::Field_varstring | ( | unsigned char * | ptr_arg, |
| uint32_t | len_arg, | ||
| uint32_t | length_bytes_arg, | ||
| unsigned char * | null_ptr_arg, | ||
| unsigned char | null_bit_arg, | ||
| const char * | field_name_arg, | ||
| const charset_info_st *const | cs ) |
Definition at line 53 of file varstring.cc.
| drizzled::Field_varstring::Field_varstring | ( | uint32_t | len_arg, |
| bool | maybe_null_arg, | ||
| const char * | field_name_arg, | ||
| const charset_info_st *const | cs ) |
Definition at line 69 of file varstring.cc.
|
inlinevirtual |
Implements drizzled::Field.
Definition at line 83 of file varstring.h.
|
inline |
Definition at line 82 of file varstring.h.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 414 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 181 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 360 of file varstring.cc.
|
virtual |
Copy a field part into an output buffer.
This function makes a copy of field part of size equal to or less than "length" parameter value. For fields of string types (VARCHAR, TEXT) the rest of buffer is padded by zero byte.
| output | buffer |
| output | buffer size |
For variable length character fields (i.e. UTF-8) the "length" parameter means a number of output buffer bytes as if all field characters have maximal possible size (mbmaxlen). In the other words, "length" parameter is a number of characters multiplied by field_charset->mbmaxlen.
| Number | of copied bytes (excluding padded zero bytes – see above). |
Reimplemented from drizzled::Field.
Definition at line 386 of file varstring.cc.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 108 of file varstring.h.
|
virtual |
Compare to key segments (always 2 byte length prefix).
Reimplemented from drizzled::Field.
Definition at line 240 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 215 of file varstring.cc.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 65 of file varstring.h.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 270 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 355 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 438 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 448 of file varstring.cc.
| unsigned char * drizzled::Field::pack | ( | unsigned char * | to, |
| const unsigned char * | from ) |
|
virtual |
Pack the field into a format suitable for storage and transfer.
To implement packing functionality, only the virtual function should be overridden. The other functions are just convenience functions and hence should not be overridden.
The value of low_byte_first is dependent on how the packed data is going to be used: for local use, e.g., temporary store on disk or in memory, use the native format since that is faster. For data that is going to be transfered to other machines (e.g., when writing data to the binary log), data should always be stored in little-endian format.
max_length characters.| to | Pointer to memory area where representation of field should be put. |
| from | Pointer to memory area where record representation of field is stored. |
| max_length | Maximum length of the field, as given in the column definition. For example, for CHAR(1000), the max_length is 1000. This information is sometimes needed to decide how to pack the data. |
| low_byte_first | true if integers should be stored little-endian, false if native format should be used. Note that for little-endian machines, the value of this flag is a moot point since the native format is little-endian. |
Reimplemented from drizzled::Field.
Definition at line 292 of file varstring.cc.
|
inlinevirtual |
Returns size (in bytes) used to store field data in memory (i.e. it returns the maximum size of the field in a row of the table, which is located in RAM).
Reimplemented from drizzled::Field.
Definition at line 63 of file varstring.h.
|
inline |
Definition at line 64 of file varstring.h.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 107 of file varstring.h.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 62 of file varstring.h.
|
virtual |
Reimplemented from drizzled::Field.
Definition at line 408 of file varstring.cc.
|
inlinevirtual |
Reimplemented from drizzled::Field_str.
Definition at line 106 of file varstring.h.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 66 of file varstring.h.
|
virtual |
Implements drizzled::Field.
Definition at line 251 of file varstring.cc.
|
virtual |
Implements drizzled::Field_str.
Definition at line 83 of file varstring.cc.
|
inlinevirtual |
Store double value in Field_varstring.
Pretty prints double number into field_length characters buffer.
| nr | number |
Reimplemented from drizzled::Field_str.
Definition at line 75 of file varstring.h.
|
virtual |
Implements drizzled::Field_str.
Definition at line 114 of file varstring.cc.
|
inlinevirtual |
Implements drizzled::Field.
Definition at line 59 of file varstring.h.
| const unsigned char * drizzled::Field::unpack | ( | unsigned char * | to, |
| const unsigned char * | from ) |
|
virtual |
Unpack a varstring field from row data.
This method is used to unpack a varstring 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 | Length bytes from the master's field data |
Reimplemented from drizzled::Field.
Definition at line 329 of file varstring.cc.
|
virtual |
Returns the number of bytes actually used to store the data of the field. So for a varstring it includes both lenght byte(s) and string data, and anything after data_length() bytes are unused.
Reimplemented from drizzled::Field.
Definition at line 282 of file varstring.cc.
|
virtual |
Reimplemented from drizzled::Field_str.
Definition at line 167 of file varstring.cc.
|
virtual |
Implements drizzled::Field.
Definition at line 141 of file varstring.cc.
|
virtual |
Implements drizzled::Field.
Definition at line 127 of file varstring.cc.
Implements drizzled::Field.
Definition at line 155 of file varstring.cc.
Definition at line 79 of file varstring.h.
|
inlinevirtual |
Reimplemented from drizzled::Field.
Definition at line 61 of file varstring.h.
|
private |
Definition at line 45 of file varstring.h.
|
static |
Definition at line 42 of file varstring.h.