Drizzled Public API Documentation

drizzled::Table Class Reference

#include <table.h>

Inheritance diagram for drizzled::Table:
drizzled::table::Concurrent drizzled::table::Shell drizzled::table::Singular drizzled::table::Temporary drizzled::table::Placeholder

List of all members.

Public Member Functions

Field ** getFields () const
FieldgetField (uint32_t arg) const
void setFields (Field **arg)
void setFieldAt (Field *arg, uint32_t arg_pos)
TablegetNext () const
Table ** getNextPtr ()
void setNext (Table *arg)
void unlink ()
TablegetPrev () const
Table ** getPrevPtr ()
void setPrev (Table *arg)
SessiongetSession ()
unsigned char * getInsertRecord () const
unsigned char * getUpdateRecord ()
const char * getAlias () const
void clearAlias ()
void setAlias (const char *arg)
memory::Rootmem ()
unsigned char * alloc (size_t arg)
char * strdup (const char *str_arg, size_t len_arg)
int report_error (int error)
int delete_table (bool free_share=false)
void resetTable (Session *session, TableShare *share, uint32_t db_stat_arg)
virtual const TableSharegetShare () const =0
virtual TableSharegetMutableShare ()=0
virtual bool hasShare () const =0
virtual void setShare (TableShare *new_share)=0
virtual void release (void)=0
uint32_t sizeKeys ()
uint32_t sizeFields ()
uint32_t getRecordLength () const
uint32_t sizeBlobFields ()
uint32_t * getBlobField ()
virtual bool hasVariableWidth () const
virtual void setVariableWidth (void)
Field_blobgetBlobFieldAt (uint32_t arg) const
uint8_t getBlobPtrSize () const
uint32_t getNullBytes () const
uint32_t getNullFields () const
unsigned char * getDefaultValues ()
const char * getSchemaName () const
const char * getTableName () const
bool isDatabaseLowByteFirst () const
bool isNameLock () const
uint32_t index_flags (uint32_t idx) const
plugin::StorageEnginegetEngine () const
CursorgetCursor () const
size_t max_row_length (const unsigned char *data)
uint32_t find_shortest_key (const key_map *usable_keys)
bool compare_record (Field **ptr)
bool records_are_comparable ()
bool compare_records ()
void storeRecord ()
void storeRecordAsInsert ()
void storeRecordAsDefault ()
void restoreRecord ()
void restoreRecordAsDefault ()
void emptyRecord ()
uint32_t getDBStat () const
void fill_item_list (List< Item > &) const
void clear_column_bitmaps (void)
void prepare_for_position (void)
void mark_columns_used_by_index_no_reset (uint32_t index, boost::dynamic_bitset<> &bitmap)
void mark_columns_used_by_index_no_reset (uint32_t index)
void mark_columns_used_by_index (uint32_t index)
void restore_column_maps_after_mark_index ()
void mark_auto_increment_column (void)
void mark_columns_needed_for_update (void)
void mark_columns_needed_for_delete (void)
void mark_columns_needed_for_insert (void)
void column_bitmaps_set (boost::dynamic_bitset<> &read_set_arg, boost::dynamic_bitset<> &write_set_arg)
void restore_column_map (const boost::dynamic_bitset<> &old)
const boost::dynamic_bitset use_all_columns (boost::dynamic_bitset<> &map)
void use_all_columns ()
void default_column_bitmaps ()
bool isReadSet (uint32_t index) const
void setReadSet (uint32_t index)
void setReadSet ()
void clearReadSet (uint32_t index)
void clearReadSet ()
bool isWriteSet (uint32_t index)
void setWriteSet (uint32_t index)
void setWriteSet ()
void clearWriteSet (uint32_t index)
void clearWriteSet ()
bool is_name_opened () const
bool needs_reopen_or_name_lock () const
void setup_table_map (TableList *table_list, uint32_t tablenr)
void mark_as_null_row ()
void free_io_cache ()
void filesort_free_buffers (bool full=false)
void intern_close_table ()
void print_error (int error, myf errflag) const
uint32_t get_dup_key (int error) const
bool operator< (const Table &right) const
virtual bool isPlaceHolder (void) const

Static Public Member Functions

static bool compare (const Table *a, const Table *b)

Public Attributes

Cursorcursor
boost::dynamic_bitset * read_set
boost::dynamic_bitset * write_set
uint32_t tablenr
uint32_t db_stat
boost::dynamic_bitset def_read_set
boost::dynamic_bitset def_write_set
boost::dynamic_bitset tmp_set
Sessionin_use
unsigned char * record [2]
std::vector< unsigned char > insert_values
KeyInfokey_info
Fieldnext_number_field
Fieldfound_next_number_field
field::Epochtimestamp_field
TableListpos_in_table_list
Ordergroup
unsigned char * null_flags
uint32_t lock_position
uint32_t lock_data_start
uint32_t lock_count
uint32_t used_fields
uint32_t status
uint32_t derived_select_number
int current_lock
bool copy_blobs
bool maybe_null
bool null_row
bool force_index
bool distinct
bool const_table
bool no_rows
bool key_read
bool no_keyread
bool open_placeholder
bool locked_by_name
bool no_cache
bool auto_increment_field_not_null
bool alias_name_used
query_id_t query_id
ha_rows quick_condition_rows
timestamp_auto_set_type timestamp_field_type
table_map map
 ID bit of table (1,2,4,8,16...)
RegInfo reginfo
key_map covering_keys
key_map quick_keys
key_map merge_keys
key_map keys_in_use_for_query
key_map keys_in_use_for_group_by
key_map keys_in_use_for_order_by
ha_rows quick_rows [MAX_KEY]
key_part_map const_key_parts [MAX_KEY]
uint32_t quick_key_parts [MAX_KEY]
uint32_t quick_n_ranges [MAX_KEY]
filesort_info sort

Private Member Functions

void init_mem_root ()

Private Attributes

Field ** field
Tablenext
Tableprev
std::string _alias
memory::Root mem_root

Friends

std::ostream & operator<< (std::ostream &output, const Table &table)

Detailed Description

Class representing a set of records, either in a temporary, normal, or derived table.

Definition at line 43 of file table.h.


Member Function Documentation

bool drizzled::Table::compare_records ( )

Compares the input and outbut record buffers of the table to see if a row has changed. The algorithm iterates over updated columns and if they are nullable compares NULL bits in the buffer before comparing actual data. Special care must be taken to compare only the relevant NULL bits and mask out all others as they may be undefined. The storage engine will not and should not touch them.

Parameters:
tableThe table to evaluate.
Returns:
true if row has changed.
false otherwise.

Definition at line 1422 of file table.cc.

References drizzled::Field::null_bit, and drizzled::Field::null_ptr.

Referenced by drizzled::update_query().

int drizzled::Table::delete_table ( bool  free_share = false)

Free information allocated by openfrm

Parameters:
Iftrue if we also want to free table_share
Note:
this should all be the destructor

Definition at line 75 of file table.cc.

Referenced by drizzled::plugin::StorageEngine::createTable().

void drizzled::Table::fill_item_list ( List< Item > &  items) const

Create Item_field for each column in the table.

Parameters:
[out]apointer to an empty list used to store items

Create Item_field object for each column in the table and initialize it with the corresponding Field. New items are created in the current Session memory root.

Return values:
falseon success
truewhen out of memory

Definition at line 1632 of file table.cc.

References field.

uint32_t drizzled::Table::get_dup_key ( int  error) const
inline
Returns:
key if error because of duplicated keys

Definition at line 556 of file table.h.

Referenced by drizzled::end_unique_update(), drizzled::prepare_record_for_error_message(), and drizzled::plugin::StorageEngine::print_error().

bool drizzled::Table::records_are_comparable ( )

True if the table's input and output record buffers are comparable using compare_records(TABLE*).

Definition at line 1403 of file table.cc.

Referenced by drizzled::update_query().

int drizzled::Table::report_error ( int  error)

Help function when we get some an error from the table Cursor.

Definition at line 1591 of file table.cc.

Referenced by drizzled::join_read_const(), and drizzled::join_read_last_key().

void drizzled::Table::setup_table_map ( TableList table_list,
uint32_t  tablenr 
)

clean/setup table fields and map.

Parameters:
tableTable structure pointer (which should be setup)
table_listTableList structure pointer (owner of Table)
tablenrtable number

Definition at line 1611 of file table.cc.

References drizzled::TableList::force_index, map, and drizzled::TableList::outer_join.


Member Data Documentation

std::string drizzled::Table::_alias
private

alias or table name if no alias

Definition at line 165 of file table.h.

bool drizzled::Table::copy_blobs

Should blobs by copied when storing?

Definition at line 178 of file table.h.

Referenced by drizzled::create_tmp_table(), and drizzled::field_conv().

int drizzled::Table::current_lock

Type of lock on table

Definition at line 177 of file table.h.

Referenced by drizzled::Session::unlock_external().

uint32_t drizzled::Table::db_stat
boost::dynamic_bitset drizzled::Table::def_read_set

Default read set of columns

Definition at line 119 of file table.h.

boost::dynamic_bitset drizzled::Table::def_write_set

Default write set of columns

Definition at line 120 of file table.h.

Field** drizzled::Table::field
private

Pointer to fields collection

Definition at line 45 of file table.h.

Referenced by fill_item_list().

Field* drizzled::Table::found_next_number_field

Points to the "next-number" field (autoincrement field)

Definition at line 143 of file table.h.

Referenced by ha_innobase::doUpdateRecord(), ha_innobase::info(), ha_innobase::innobase_initialize_autoinc(), drizzled::insert_query(), and drizzled::prepare_alter_table().

uint32_t drizzled::Table::lock_count
uint32_t drizzled::Table::lock_data_start

Start pos. in DRIZZLE_LOCK.locks

Definition at line 171 of file table.h.

Referenced by drizzled::Session::get_lock_data(), and drizzled::Session::unlockReadTables().

uint32_t drizzled::Table::lock_position

Position in DRIZZLE_LOCK.table

Definition at line 170 of file table.h.

Referenced by drizzled::Session::get_lock_data(), and drizzled::Session::unlockReadTables().

Field* drizzled::Table::next_number_field

Set if next_number is activated. What the heck is the difference between this and the next member?

Definition at line 142 of file table.h.

Referenced by ha_innobase::doInsertRecord(), ha_innobase::doUpdateRecord(), drizzled::insert_query(), and drizzled::set_field_to_null_with_conversions().

ha_rows drizzled::Table::quick_condition_rows

Estimate of number of records that satisfy SARGable part of the table condition, or table->cursor->records if no SARGable condition could be constructed. This value is used by join optimizer as an estimate of number of records that will pass the table condition (condition that depends on fields of this table and constants)

Definition at line 255 of file table.h.

Referenced by drizzled::best_access_path(), drizzled::make_join_statistics(), and drizzled::test_if_skip_sort_order().

field::Epoch* drizzled::Table::timestamp_field

Points to the auto-setting timestamp field, if any

Definition at line 144 of file table.h.

Referenced by drizzled::CreateField::CreateField(), and drizzled::update_query().


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