drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::field::Boolean Class Reference
Inheritance diagram for drizzled::field::Boolean:
[legend]
Collaboration diagram for drizzled::field::Boolean:
[legend]

Public Member Functions

 Boolean (unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, const char *field_name_arg, bool ansi_display=false)
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 key_length () const
int store (const char *to, uint32_t length, const charset_info_st *const charset)
int store (double)
int store (int64_t nr, bool unsigned_val)
int store_decimal (const drizzled::type::Decimal *)
String * val_str (String *, String *) const
double val_real () const
int64_t val_int () const
type::Decimal * val_decimal (type::Decimal *) const
Item_result result_type () const
int cmp (const unsigned char *, const unsigned char *)
void sort_string (unsigned char *, uint32_t)
uint32_t max_display_length ()
bool can_be_compared_as_int64_t () const
String * val_str (String *str)
uint32_t size_of () 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 &ltime, type::timestamp_t t_type)
String * val_str_internal (String *str) const
virtual bool str_needs_quotes ()
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 uint32_t used_length ()
virtual uint32_t sort_length () const
virtual uint32_t max_data_length () const
virtual void reset_fields ()
virtual void set_default ()
virtual bool binary () const
virtual enum_field_types real_type () const
virtual int cmp_max (const unsigned char *a, const unsigned char *b, uint32_t max_len)
int cmp_internal (const unsigned char *str)
virtual int cmp_binary (const unsigned char *a, const unsigned char *b, uint32_t max_length=UINT32_MAX)
virtual int cmp_offset (uint32_t row_offset)
virtual int cmp_binary_offset (uint32_t row_offset)
virtual int key_cmp (const unsigned char *a, const unsigned char *b)
virtual int key_cmp (const unsigned char *str, uint32_t length)
virtual uint32_t decimals () const
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 void free ()
virtual Field * new_field (memory::Root *, Table *, bool keep_type)
virtual Field * new_key_field (memory::Root *root, Table *new_table, unsigned char *new_ptr, unsigned char *new_null_ptr, uint32_t new_null_bit)
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)
virtual uint32_t get_key_image (unsigned char *buff, uint32_t length)
virtual uint32_t get_key_image (std::basic_string< unsigned char > &buff, uint32_t length)
virtual void set_key_image (const unsigned char *buff, uint32_t length)
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)
virtual unsigned char * pack (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first)
unsigned char * pack (unsigned char *to, const unsigned char *from)
virtual const unsigned char * unpack (unsigned char *to, const unsigned char *from, uint32_t param_data, bool low_byte_first)
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)
virtual uint32_t max_packed_col_length (uint32_t max_length)
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 &ltime, uint32_t fuzzydate) const
virtual bool get_time (type::Time &ltime) const
virtual const charset_info_st * charset (void) const
virtual const charset_info_st * sort_charset (void) const
virtual bool has_charset (void) const
virtual void set_charset (const charset_info_st *const)
virtual enum Derivation derivation (void) const
virtual void set_derivation (enum Derivation)
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 Member Functions

static size_t max_string_length ()
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)

Private Member Functions

void set (bool v)
bool isTrue () const

Private Attributes

bool ansi_display

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
}
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
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

Detailed Description

Definition at line 29 of file field/boolean.h.

Constructor & Destructor Documentation

◆ Boolean()

drizzled::field::Boolean::Boolean ( unsigned char * ptr_arg,
uint32_t len_arg,
unsigned char * null_ptr_arg,
unsigned char null_bit_arg,
const char * field_name_arg,
bool ansi_display = false )

Definition at line 35 of file field/boolean.cc.

Member Function Documentation

◆ can_be_compared_as_int64_t()

bool drizzled::field::Boolean::can_be_compared_as_int64_t ( ) const
inlinevirtual

Returns true for fields which, when compared with constant items, can be casted to int64_t. In this case we will at 'fix_fields' stage cast the constant items to int64_ts and at the execution stage use field->val_int() for comparison. Used to optimize clauses like 'a_column BETWEEN date_const AND date_const'.

Reimplemented from drizzled::Field.

Definition at line 63 of file field/boolean.h.

◆ cmp()

int drizzled::field::Boolean::cmp ( const unsigned char * a,
const unsigned char * b )
virtual

Implements drizzled::Field.

Definition at line 52 of file field/boolean.cc.

◆ isTrue()

bool drizzled::field::Boolean::isTrue ( ) const
inlineprivate

Definition at line 82 of file field/boolean.h.

◆ key_length()

uint32_t drizzled::field::Boolean::key_length ( ) const
inlinevirtual

Reimplemented from drizzled::Field.

Definition at line 46 of file field/boolean.h.

◆ key_type()

enum ha_base_keytype drizzled::field::Boolean::key_type ( ) const
inlinevirtual

Reimplemented from drizzled::Field.

Definition at line 42 of file field/boolean.h.

◆ max_display_length()

uint32_t drizzled::field::Boolean::max_display_length ( )
inlinevirtual

Implements drizzled::Field.

Definition at line 61 of file field/boolean.h.

◆ max_string_length()

size_t drizzled::field::Boolean::max_string_length ( )
inlinestatic

Definition at line 71 of file field/boolean.h.

◆ pack_length()

uint32_t drizzled::field::Boolean::pack_length ( ) const
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 45 of file field/boolean.h.

◆ reset()

int drizzled::field::Boolean::reset ( void )
inlinevirtual

Reimplemented from drizzled::Field.

Definition at line 44 of file field/boolean.h.

◆ result_type()

Item_result drizzled::field::Boolean::result_type ( ) const
inlinevirtual

Implements drizzled::Field.

Definition at line 58 of file field/boolean.h.

◆ set()

void drizzled::field::Boolean::set ( bool v)
inlineprivate

Definition at line 77 of file field/boolean.h.

◆ size_of()

uint32_t drizzled::field::Boolean::size_of ( ) const
inlinevirtual

Implements drizzled::Field.

Definition at line 69 of file field/boolean.h.

◆ sort_string()

void drizzled::field::Boolean::sort_string ( unsigned char * to,
uint32_t length_arg )
virtual

Implements drizzled::Field.

Definition at line 122 of file field/boolean.cc.

◆ store() [1/3]

int drizzled::field::Boolean::store ( const char * to,
uint32_t length,
const charset_info_st *const charset )
virtual

Implements drizzled::Field.

Definition at line 57 of file field/boolean.cc.

◆ store() [2/3]

int drizzled::field::Boolean::store ( double nr)
virtual

Implements drizzled::Field.

Definition at line 78 of file field/boolean.cc.

◆ store() [3/3]

int drizzled::field::Boolean::store ( int64_t nr,
bool unsigned_val )
virtual

Implements drizzled::Field.

Definition at line 71 of file field/boolean.cc.

◆ store_decimal()

int drizzled::field::Boolean::store_decimal ( const drizzled::type::Decimal * dec)
virtual

Implements drizzled::Field.

Definition at line 85 of file field/boolean.cc.

◆ type()

enum_field_types drizzled::field::Boolean::type ( ) const
inlinevirtual

Implements drizzled::Field.

Definition at line 41 of file field/boolean.h.

◆ val_decimal()

type::Decimal * drizzled::field::Boolean::val_decimal ( type::Decimal * dec) const
virtual

Reimplemented from drizzled::Field.

Definition at line 111 of file field/boolean.cc.

◆ val_int()

int64_t drizzled::field::Boolean::val_int ( void ) const
virtual

Implements drizzled::Field.

Definition at line 98 of file field/boolean.cc.

◆ val_real()

double drizzled::field::Boolean::val_real ( void ) const
virtual

Implements drizzled::Field.

Definition at line 92 of file field/boolean.cc.

◆ val_str() [1/2]

String * drizzled::field::Boolean::val_str ( String * val_buffer,
String *  ) const
virtual

Implements drizzled::Field.

Definition at line 104 of file field/boolean.cc.

◆ val_str() [2/2]

String * drizzled::field::Boolean::val_str ( String * str)
inline

Definition at line 68 of file field/boolean.h.

◆ zero_pack()

bool drizzled::field::Boolean::zero_pack ( ) const
inlinevirtual

Reimplemented from drizzled::Field.

Definition at line 43 of file field/boolean.h.

Member Data Documentation

◆ ansi_display

bool drizzled::field::Boolean::ansi_display
private

Definition at line 31 of file field/boolean.h.


The documentation for this class was generated from the following files: