drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ha_innodb.cc File Reference
#include <config.h>
#include <limits.h>
#include <fcntl.h>
#include <drizzled/error.h>
#include <drizzled/errmsg_print.h>
#include <drizzled/internal/m_string.h>
#include <drizzled/internal/my_sys.h>
#include <drizzled/plugin.h>
#include <drizzled/show.h>
#include <drizzled/data_home.h>
#include <drizzled/catalog/local.h>
#include <drizzled/field.h>
#include <drizzled/charset.h>
#include <drizzled/session.h>
#include <drizzled/current_session.h>
#include <drizzled/table.h>
#include <drizzled/field/blob.h>
#include <drizzled/field/varstring.h>
#include <drizzled/plugin/xa_storage_engine.h>
#include <drizzled/plugin/daemon.h>
#include <drizzled/memory/multi_malloc.h>
#include <drizzled/pthread_globals.h>
#include <drizzled/named_savepoint.h>
#include <drizzled/session/table_messages.h>
#include <drizzled/transaction_services.h>
#include <drizzled/message/statement_transform.h>
#include <drizzled/cached_directory.h>
#include <drizzled/statistics_variables.h>
#include <drizzled/system_variables.h>
#include <drizzled/session/times.h>
#include <drizzled/session/transactions.h>
#include <drizzled/typelib.h>
#include <drizzled/key_part_info.h>
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
#include <boost/scoped_array.hpp>
#include <boost/filesystem.hpp>
#include <drizzled/module/option_map.h>
#include <iostream>
#include "univ.i"
#include "buf0lru.h"
#include "btr0sea.h"
#include "os0file.h"
#include "os0thread.h"
#include "srv0start.h"
#include "srv0srv.h"
#include "trx0roll.h"
#include "trx0trx.h"
#include "trx0sys.h"
#include "mtr0mtr.h"
#include "row0ins.h"
#include "row0mysql.h"
#include "row0sel.h"
#include "row0upd.h"
#include "log0log.h"
#include "lock0lock.h"
#include "dict0crea.h"
#include "create_replication.h"
#include "btr0cur.h"
#include "btr0btr.h"
#include "fsp0fsp.h"
#include "sync0sync.h"
#include "fil0fil.h"
#include "trx0xa.h"
#include "row0merge.h"
#include "dict0boot.h"
#include "ha_prototypes.h"
#include "ut0mem.h"
#include "ibuf0ibuf.h"
#include "ha_innodb.h"
#include "data_dictionary.h"
#include "replication_dictionary.h"
#include "internal_dictionary.h"
#include "handler0vars.h"
#include <sstream>
#include <string>
#include <plugin/innobase/handler/status_function.h>
#include <plugin/innobase/handler/replication_log.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/text_format.h>
#include <boost/thread/mutex.hpp>

Go to the source code of this file.

Classes

class  InnobaseEngine
class  string
 STL class. More...

Macros

#define INSIDE_HA_INNOBASE_CC
#define EQ_CURRENT_SESSION(session)
#define INNOBASE_WAKE_INTERVAL   32

Typedefs

typedef constrained_check< uint32_t, UINT32_MAX, 10 > open_files_constraint
typedef constrained_check< uint32_t, 10, 1 > mirrored_log_groups_constraint
typedef constrained_check< uint32_t, 100, 2 > log_files_in_group_constraint
typedef constrained_check< uint32_t, 6, 0 > force_recovery_constraint
typedef constrained_check< size_t, SIZE_MAX, 256 *1024, 1024 > log_buffer_constraint
typedef constrained_check< size_t, SIZE_MAX, 512 *1024, 1024 > additional_mem_pool_constraint
typedef constrained_check< unsigned int, 1000, 1 > autoextend_constraint
typedef constrained_check< size_t, SIZE_MAX, 33554432, 1048576 > buffer_pool_constraint
typedef constrained_check< uint32_t, MAX_BUFFER_POOLS, 1 > buffer_pool_instances_constraint
typedef constrained_check< uint32_t,(1<< UNIV_PAGE_SIZE_SHIFT_MAX),(1<< 12)> page_size_constraint
typedef constrained_check< uint32_t,(1<< UNIV_PAGE_SIZE_SHIFT_MAX),(1<< 9)> log_block_size_constraint
typedef constrained_check< uint32_t, UINT32_MAX, 100 > io_capacity_constraint
typedef constrained_check< uint32_t, 5000, 1 > purge_batch_constraint
typedef constrained_check< uint32_t, 1, 0 > purge_threads_constraint
typedef constrained_check< uint32_t, 2, 0 > trinary_constraint
typedef constrained_check< unsigned int, 99, 0 > max_dirty_pages_constraint
typedef constrained_check< uint32_t, 64, 1 > io_threads_constraint
typedef constrained_check< uint32_t, 1000, 0 > concurrency_constraint
typedef constrained_check< int64_t, INT64_MAX, 1024 *1024, 1024 *1024 > log_file_constraint
typedef constrained_check< uint32_t, 95, 5 > old_blocks_constraint
typedef constrained_check< uint32_t, 64, 0 > read_ahead_threshold_constraint
typedef constrained_check< uint32_t, 1, 0 > binary_constraint
typedef constrained_check< uint32_t, 999999999, 100 > ibuf_accel_rate_constraint
typedef constrained_check< uint32_t, TRX_SYS_N_RSEGS, 1 > rollback_segments_constraint
typedef constrained_check< uint32_t, 1024 *1024 *1024, 1 > lock_wait_constraint

Functions

static INNOBASE_SHARE * get_share (const char *table_name)
static void free_share (INNOBASE_SHARE *share)
static uint innobase_file_format_name_lookup (const char *format_name)
static int innobase_file_format_validate_and_set (const char *format_max)
static void innobase_commit_low (trx_t *trx)
UNIV_INTERN ibool thd_is_replication_slave_thread (drizzled::Session *)
static void innodb_srv_conc_enter_innodb (trx_t *trx)
static void innodb_srv_conc_exit_innodb (trx_t *trx)
static void innobase_release_stat_resources (trx_t *trx)
UNIV_INTERN ibool thd_has_edited_nontrans_tables (drizzled::Session *session)
UNIV_INTERN ibool thd_is_select (const drizzled::Session *session)
UNIV_INTERN ibool thd_supports_xa (drizzled::Session *)
UNIV_INTERN ulong thd_lock_wait_timeout (drizzled::Session *)
UNIV_INTERN void thd_set_lock_wait_time (drizzled::Session *in_session, ulint value)
static trx_t *& session_to_trx (Session *session)
static void innobase_active_small (void)
UNIV_INTERN int convert_error_code_to_mysql (int error, ulint flags, Session *session)
UNIV_INTERN void innobase_mysql_print_thd (FILE *f, drizzled::Session *in_session, uint)
UNIV_INTERN void innobase_get_cset_width (ulint cset, ulint *mbminlen, ulint *mbmaxlen)
UNIV_INTERN void innobase_convert_from_table_id (const void *, char *to, const char *from, ulint len)
UNIV_INTERN void innobase_convert_from_id (const void *, char *to, const char *from, ulint len)
UNIV_INTERN int innobase_strcasecmp (const char *a, const char *b)
const char * innobase_basename (const char *path_name)
UNIV_INTERN void innobase_casedn_str (char *a)
UNIV_INTERN bool innobase_isspace (const void *cs, char char_to_test)
UNIV_INTERN int innobase_mysql_tmpfile (void)
UNIV_INTERN ulint innobase_raw_format (const char *data, ulint data_len, ulint, char *buf, ulint buf_size)
static uint64_t innobase_next_autoinc (uint64_t current, uint64_t increment, uint64_t offset, uint64_t max_value)
static void innobase_trx_init (Session *session, trx_t *trx)
UNIV_INTERN trx_t * innobase_trx_allocate (Session *session)
static trx_t * check_trx_exists (Session *session)
static char * innobase_convert_identifier (char *buf, ulint buflen, const char *id, ulint idlen, drizzled::Session *session, ibool file_id)
UNIV_INTERN char * innobase_convert_name (char *buf, ulint buflen, const char *id, ulint idlen, drizzled::Session *session, ibool table_id)
UNIV_INTERN ibool trx_is_interrupted (trx_t *trx)
UNIV_INTERN ibool trx_is_strict (trx_t *trx)
static void reset_template (row_prebuilt_t *prebuilt)
template<class T>
void align_value (T &value, size_t align_val=1024)
static void auto_extend_update (Session *, sql_var_t)
static void io_capacity_update (Session *, sql_var_t)
static void purge_batch_update (Session *, sql_var_t)
static void purge_threads_update (Session *, sql_var_t)
static void innodb_adaptive_hash_index_update (Session *, sql_var_t)
static void innodb_old_blocks_pct_update (Session *, sql_var_t)
static void innodb_thread_concurrency_update (Session *, sql_var_t)
static void innodb_rollback_segments_update (Session *, sql_var_t)
static void innodb_sync_spin_loops_update (Session *, sql_var_t)
static void innodb_spin_wait_delay_update (Session *, sql_var_t)
static void innodb_thread_sleep_delay_update (Session *, sql_var_t)
static void innodb_read_ahead_threshold_update (Session *, sql_var_t)
static void auto_lru_dump_update (Session *, sql_var_t)
static void ibuf_active_contract_update (Session *, sql_var_t)
static void ibuf_accel_rate_update (Session *, sql_var_t)
static void checkpoint_age_target_update (Session *, sql_var_t)
static void flush_neighbor_pages_update (Session *, sql_var_t)
static int innodb_commit_concurrency_validate (Session *session, set_var *var)
static int innodb_file_format_name_validate (Session *, set_var *var)
static int innodb_stats_method_validate (Session *, set_var *var)
static int innodb_change_buffering_validate (Session *, set_var *var)
static int innodb_file_format_max_validate (Session *session, set_var *var)
static int read_ahead_validate (Session *, set_var *var)
static int adaptive_flushing_method_validate (Session *, set_var *var)
static int innobase_init (module::Context &context)
static int innobase_rollback_trx (trx_t *trx)
static uint64_t innobase_get_int_col_max_value (const Field *field)
static ibool innobase_match_index_columns (const KeyInfo *key_info, const dict_index_t *index_info)
static ibool innobase_build_index_translation (const Table *table, dict_table_t *ib_table, INNOBASE_SHARE *share)
static dict_index_t * innobase_index_lookup (INNOBASE_SHARE *share, uint keynr)
static uint get_field_offset (Table *table, Field *field)
static uint field_in_record_is_null (Table *table, Field *field, char *record)
static void set_field_in_record_to_null (Table *table, Field *field, char *record)
UNIV_INTERN int innobase_mysql_cmp (int mysql_type, uint charset_number, const unsigned char *a, unsigned int a_length, const unsigned char *b, unsigned int b_length)
UNIV_INTERN ulint get_innobase_type_from_mysql_type (ulint *unsigned_flag, const void *f)
static void innobase_write_to_2_little_endian (byte *buf, ulint val)
static uint innobase_read_from_2_little_endian (const unsigned char *buf)
static void build_template (row_prebuilt_t *prebuilt, Session *, Table *table, uint templ_type)
static int calc_row_difference (upd_t *uvect, unsigned char *old_row, unsigned char *new_row, Table *table, unsigned char *upd_buff, ulint buff_len, row_prebuilt_t *prebuilt, Session *)
static ulint convert_search_mode_to_innobase (enum ha_rkey_function find_flag)
static int create_table_def (trx_t *trx, Table *form, const char *table_name, const char *path_of_temp_table, ulint flags)
static int create_index (trx_t *trx, Table *form, ulint flags, const char *table_name, uint key_num)
static int create_clustered_index_when_no_primary (trx_t *trx, ulint flags, const char *table_name)
static int innobase_rename_table (trx_t *trx, const identifier::Table &from, const identifier::Table &to, ibool lock_and_commit)
static unsigned int innobase_get_mysql_key_number_for_index (INNOBASE_SHARE *share, const drizzled::Table *table, dict_table_t *ib_table, const dict_index_t *index)
static ha_rows innodb_rec_per_key (dict_index_t *index, ulint i, ha_rows records)
static ulint innobase_map_isolation_level (enum_tx_isolation iso)
static bool innodb_show_status (plugin::StorageEngine *engine, Session *session, stat_print_fn *stat_print)
static bool innodb_mutex_show_status (plugin::StorageEngine *engine, Session *session, stat_print_fn *stat_print)
ulint innobase_get_at_most_n_mbchars (ulint charset_id, ulint prefix_len, ulint data_len, const char *str)
static void init_options (drizzled::module::option_context &context)
UNIV_INTERN bool innobase_index_name_is_reserved (const trx_t *trx, const KeyInfo *key_info, ulint num_of_keys)

Variables

static boost::mutex innobase_share_mutex
static ulong commit_threads = 0
static boost::condition_variable commit_cond
static boost::mutex commit_cond_m
static bool innodb_inited = 0
static plugin::XaStorageEngine * innodb_engine_ptr = NULL
static open_files_constraint innobase_open_files
static mirrored_log_groups_constraint innobase_mirrored_log_groups
static log_files_in_group_constraint innobase_log_files_in_group
force_recovery_constraint innobase_force_recovery
static log_buffer_constraint innobase_log_buffer_size
static additional_mem_pool_constraint innobase_additional_mem_pool_size
static autoextend_constraint innodb_auto_extend_increment
static buffer_pool_constraint innobase_buffer_pool_size
static buffer_pool_instances_constraint innobase_buffer_pool_instances
static page_size_constraint innobase_page_size
static log_block_size_constraint innobase_log_block_size
static io_capacity_constraint innodb_io_capacity
static purge_batch_constraint innodb_purge_batch_size
static purge_threads_constraint innodb_n_purge_threads
static trinary_constraint innodb_flush_log_at_trx_commit
static max_dirty_pages_constraint innodb_max_dirty_pages_pct
static uint64_constraint innodb_max_purge_lag
static uint64_nonzero_constraint innodb_stats_sample_pages
static io_threads_constraint innobase_read_io_threads
static io_threads_constraint innobase_write_io_threads
static concurrency_constraint innobase_commit_concurrency
static concurrency_constraint innobase_thread_concurrency
static uint32_nonzero_constraint innodb_concurrency_tickets
static log_file_constraint innobase_log_file_size
static uint64_constraint innodb_replication_delay
static uint32_constraint buffer_pool_restore_at_startup
static old_blocks_constraint innobase_old_blocks_pct
static uint32_constraint innodb_sync_spin_loops
static uint32_constraint innodb_spin_wait_delay
static uint32_constraint innodb_thread_sleep_delay
static read_ahead_threshold_constraint innodb_read_ahead_threshold
static uint64_constraint ibuf_max_size
static binary_constraint ibuf_active_contract
static ibuf_accel_rate_constraint ibuf_accel_rate
static uint32_constraint checkpoint_age_target
static binary_constraint flush_neighbor_pages
static string sysvar_transaction_log_use_replicator
static rollback_segments_constraint innobase_rollback_segments
std::string innobase_data_home_dir
std::string innobase_data_file_path
std::string innobase_log_group_home_dir
static string innobase_file_format_name
static string innobase_change_buffering
static string read_ahead
static string adaptive_flushing_method
static string innobase_file_format_max
static trinary_constraint innobase_fast_shutdown
static my_bool innobase_file_format_check = TRUE
static my_bool innobase_use_doublewrite = TRUE
static my_bool innobase_use_checksums = TRUE
static my_bool innobase_rollback_on_timeout = FALSE
static my_bool innobase_create_status_file = FALSE
static bool innobase_use_replication_log
static bool support_xa
static bool strict_mode
static lock_wait_constraint lock_wait_timeout
static char * internal_innobase_data_file_path = NULL
static const char * innodb_stats_method_names []
static string innodb_stats_method
static ulong innobase_active_counter = 0
static hash_table_t * innobase_open_tables
static const char * innobase_change_buffering_values [IBUF_USE_COUNT]
static const char * read_ahead_names []
static TYPELIB read_ahead_typelib
static const char * adaptive_flushing_method_names []
static TYPELIB adaptive_flushing_method_typelib
static const char innobase_index_reserve_name [] = "GEN_CLUST_INDEX"
static const char * ha_innobase_exts []
static const char innobase_engine_name [] = "InnoDB"
static drizzle_show_var innodb_status_variables []
 DRIZZLE_DECLARE_PLUGIN

Macro Definition Documentation

◆ EQ_CURRENT_SESSION

#define EQ_CURRENT_SESSION ( session)
Value:
((session) == current_session)

Definition at line 165 of file ha_innodb.cc.

◆ INNOBASE_WAKE_INTERVAL

#define INNOBASE_WAKE_INTERVAL   32

Definition at line 316 of file ha_innodb.cc.

◆ INSIDE_HA_INNOBASE_CC

#define INSIDE_HA_INNOBASE_CC

Definition at line 156 of file ha_innodb.cc.

Typedef Documentation

◆ additional_mem_pool_constraint

typedef constrained_check<size_t, SIZE_MAX, 512*1024, 1024> additional_mem_pool_constraint

Definition at line 180 of file ha_innodb.cc.

◆ autoextend_constraint

typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint

Definition at line 182 of file ha_innodb.cc.

◆ binary_constraint

typedef constrained_check<uint32_t, 1, 0> binary_constraint

Definition at line 238 of file ha_innodb.cc.

◆ buffer_pool_constraint

typedef constrained_check<size_t, SIZE_MAX, 33554432, 1048576> buffer_pool_constraint

Definition at line 184 of file ha_innodb.cc.

◆ buffer_pool_instances_constraint

typedef constrained_check<uint32_t, MAX_BUFFER_POOLS, 1> buffer_pool_instances_constraint

Definition at line 186 of file ha_innodb.cc.

◆ concurrency_constraint

typedef constrained_check<uint32_t, 1000, 0> concurrency_constraint

Definition at line 212 of file ha_innodb.cc.

◆ force_recovery_constraint

typedef constrained_check<uint32_t, 6, 0> force_recovery_constraint

Definition at line 176 of file ha_innodb.cc.

◆ ibuf_accel_rate_constraint

typedef constrained_check<uint32_t, 999999999, 100> ibuf_accel_rate_constraint

Definition at line 241 of file ha_innodb.cc.

◆ io_capacity_constraint

typedef constrained_check<uint32_t, UINT32_MAX, 100> io_capacity_constraint

Definition at line 196 of file ha_innodb.cc.

◆ io_threads_constraint

typedef constrained_check<uint32_t, 64, 1> io_threads_constraint

Definition at line 208 of file ha_innodb.cc.

◆ lock_wait_constraint

typedef constrained_check<uint32_t, 1024*1024*1024, 1> lock_wait_constraint

Definition at line 294 of file ha_innodb.cc.

◆ log_block_size_constraint

typedef constrained_check<uint32_t, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), (1 << 9)> log_block_size_constraint

Definition at line 194 of file ha_innodb.cc.

◆ log_buffer_constraint

typedef constrained_check<size_t, SIZE_MAX, 256*1024, 1024> log_buffer_constraint

Definition at line 178 of file ha_innodb.cc.

◆ log_file_constraint

typedef constrained_check<int64_t, INT64_MAX, 1024*1024, 1024*1024> log_file_constraint

Definition at line 217 of file ha_innodb.cc.

◆ log_files_in_group_constraint

typedef constrained_check<uint32_t, 100, 2> log_files_in_group_constraint

Definition at line 174 of file ha_innodb.cc.

◆ max_dirty_pages_constraint

typedef constrained_check<unsigned int, 99, 0> max_dirty_pages_constraint

Definition at line 204 of file ha_innodb.cc.

◆ mirrored_log_groups_constraint

typedef constrained_check<uint32_t, 10, 1> mirrored_log_groups_constraint

Definition at line 172 of file ha_innodb.cc.

◆ old_blocks_constraint

typedef constrained_check<uint32_t, 95, 5> old_blocks_constraint

Percentage of the buffer pool to reserve for 'old' blocks. Connected to buf_LRU_old_ratio.

Definition at line 226 of file ha_innodb.cc.

◆ open_files_constraint

typedef constrained_check<uint32_t, UINT32_MAX, 10> open_files_constraint

Definition at line 170 of file ha_innodb.cc.

◆ page_size_constraint

typedef constrained_check<uint32_t, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), (1 << 12)> page_size_constraint

Definition at line 190 of file ha_innodb.cc.

◆ purge_batch_constraint

typedef constrained_check<uint32_t, 5000, 1> purge_batch_constraint

Definition at line 198 of file ha_innodb.cc.

◆ purge_threads_constraint

typedef constrained_check<uint32_t, 1, 0> purge_threads_constraint

Definition at line 200 of file ha_innodb.cc.

◆ read_ahead_threshold_constraint

typedef constrained_check<uint32_t, 64, 0> read_ahead_threshold_constraint

Definition at line 233 of file ha_innodb.cc.

◆ rollback_segments_constraint

typedef constrained_check<uint32_t, TRX_SYS_N_RSEGS, 1> rollback_segments_constraint

Definition at line 248 of file ha_innodb.cc.

◆ trinary_constraint

typedef constrained_check<uint32_t, 2, 0> trinary_constraint

Definition at line 202 of file ha_innodb.cc.

Function Documentation

◆ adaptive_flushing_method_validate()

int adaptive_flushing_method_validate ( Session * ,
set_var * var )
static

Check if argument is a valid value for srv_adaptive_flushing_method and set it. This function is registered as a callback with MySQL.

Returns
0 for valid read_ahead value

Definition at line 2204 of file ha_innodb.cc.

◆ align_value()

template<class T>
void align_value ( T & value,
size_t align_val = 1024 )

Definition at line 1914 of file ha_innodb.cc.

◆ auto_extend_update()

void auto_extend_update ( Session * ,
sql_var_t  )
static

Definition at line 1919 of file ha_innodb.cc.

◆ auto_lru_dump_update()

void auto_lru_dump_update ( Session * ,
sql_var_t  )
static

Definition at line 1985 of file ha_innodb.cc.

◆ build_template()

void build_template ( row_prebuilt_t * prebuilt,
Session * ,
Table * table,
uint templ_type )
static

Builds a 'template' to the prebuilt struct. The template is used in fast retrieval of just those column values MySQL needs in its processing.

Parameters
prebuiltin/out: prebuilt struct
tablein: MySQL table
templ_typein: ROW_MYSQL_WHOLE_ROW or ROW_DRIZZLE_REC_FIELDS

Definition at line 4353 of file ha_innodb.cc.

◆ calc_row_difference()

int calc_row_difference ( upd_t * uvect,
unsigned char * old_row,
unsigned char * new_row,
Table * table,
unsigned char * upd_buff,
ulint buff_len,
row_prebuilt_t * prebuilt,
Session *  )
static

Checks which fields have changed in a row and stores information of them to an update vector.

Returns
error number or 0
Parameters
uvectin/out: update vector
old_rowin: old row in MySQL format
new_rowin: new row in MySQL format
tablein: table in MySQL data dictionary
upd_buffin: buffer to use
buff_lenin: buffer length
prebuiltin: InnoDB prebuilt struct

Definition at line 4857 of file ha_innodb.cc.

◆ check_trx_exists()

trx_t * check_trx_exists ( Session * session)
static

Gets the InnoDB transaction handle for a MySQL Cursor object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one.

Returns
InnoDB transaction handle
Parameters
sessionin: user thread handle

Definition at line 1661 of file ha_innodb.cc.

◆ checkpoint_age_target_update()

void checkpoint_age_target_update ( Session * ,
sql_var_t  )
static

Definition at line 2000 of file ha_innodb.cc.

◆ convert_error_code_to_mysql()

UNIV_INTERN int convert_error_code_to_mysql ( int error,
ulint flags,
Session * session )

Converts an InnoDB error code to a MySQL error code and also tells to MySQL about a possible transaction rollback inside InnoDB caused by a lock wait timeout or a deadlock.

Returns
MySQL error code
Parameters
errorin: InnoDB error code
flagsin: InnoDB table flags, or 0
sessionin: user thread handle or NULL

Definition at line 1118 of file ha_innodb.cc.

◆ convert_search_mode_to_innobase()

ulint convert_search_mode_to_innobase ( enum ha_rkey_function find_flag)
inlinestatic

Converts a search mode flag understood by MySQL to a flag understood by InnoDB.

Definition at line 5279 of file ha_innodb.cc.

◆ create_clustered_index_when_no_primary()

int create_clustered_index_when_no_primary ( trx_t * trx,
ulint flags,
const char * table_name )
static

Creates an index to an InnoDB table when the user has defined no primary index.

Parameters
trxin: InnoDB transaction handle
flagsin: InnoDB table flags
table_namein: table name

Definition at line 6264 of file ha_innodb.cc.

◆ create_index()

int create_index ( trx_t * trx,
Table * form,
ulint flags,
const char * table_name,
uint key_num )
static

Creates an index in an InnoDB database.

Parameters
trxin: InnoDB transaction handle
formin: information on table columns and indexes
flagsin: InnoDB table flags
table_namein: table name
key_numin: index number

Definition at line 6137 of file ha_innodb.cc.

◆ create_table_def()

int create_table_def ( trx_t * trx,
Table * form,
const char * table_name,
const char * path_of_temp_table,
ulint flags )
static

Creates a table definition to an InnoDB database.

Parameters
trxin: InnoDB transaction handle
formin: information on table columns and indexes
table_namein: table name
path_of_temp_tablein: if this is a table explicitly created by the user with the TEMPORARY keyword, then this parameter is the dir path where the table should be placed if we create an .ibd file for it (no .ibd extension in the path, though); otherwise this is NULL
flagsin: table flags

Definition at line 5978 of file ha_innodb.cc.

◆ field_in_record_is_null()

uint field_in_record_is_null ( Table * table,
Field * field,
char * record )
inlinestatic

Checks if a field in a record is SQL NULL. Uses the record format information in table to track the null bit in record.

Returns
1 if NULL, 0 otherwise
Parameters
tablein: MySQL table object
fieldin: MySQL field object
recordin: a row in MySQL format

Definition at line 3882 of file ha_innodb.cc.

◆ flush_neighbor_pages_update()

void flush_neighbor_pages_update ( Session * ,
sql_var_t  )
static

Definition at line 2005 of file ha_innodb.cc.

◆ free_share()

void free_share ( INNOBASE_SHARE * share)
static

Definition at line 8644 of file ha_innodb.cc.

◆ get_field_offset()

uint get_field_offset ( Table * table,
Field * field )
inlinestatic

Gets field offset for a field in a table.

Returns
offset
Parameters
tablein: MySQL table object
fieldin: MySQL field object

Definition at line 3868 of file ha_innodb.cc.

◆ get_innobase_type_from_mysql_type()

UNIV_INTERN ulint get_innobase_type_from_mysql_type ( ulint * unsigned_flag,
const void * f )

Converts a MySQL type to an InnoDB type. Note that this function returns the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.

Returns
DATA_BINARY, DATA_VARCHAR, ...
Parameters
unsigned_flagout: DATA_UNSIGNED if an 'unsigned type'; at least ENUM and SET, and unsigned integer types are 'unsigned types'
fin: MySQL Field

Definition at line 4015 of file ha_innodb.cc.

◆ get_share()

INNOBASE_SHARE * get_share ( const char * table_name)
static

Handling the shared INNOBASE_SHARE structure that is needed to provide table locking.

Definition at line 8610 of file ha_innodb.cc.

◆ ibuf_accel_rate_update()

void ibuf_accel_rate_update ( Session * ,
sql_var_t  )
static

Definition at line 1995 of file ha_innodb.cc.

◆ ibuf_active_contract_update()

void ibuf_active_contract_update ( Session * ,
sql_var_t  )
static

Definition at line 1990 of file ha_innodb.cc.

◆ init_options()

void init_options ( drizzled::module::option_context & context)
static

Definition at line 9437 of file ha_innodb.cc.

◆ innobase_active_small()

void innobase_active_small ( void )
inlinestatic

Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth time calls srv_active_wake_master_thread. This function should be used when a single database operation may introduce a small need for server utility activity, like checkpointing.

Definition at line 1101 of file ha_innodb.cc.

◆ innobase_basename()

const char * innobase_basename ( const char * path_name)

Strip dir name from a full path name and return only the file name

Returns
file name or "null" if no file name
Parameters
path_namein: full path name

Definition at line 1355 of file ha_innodb.cc.

◆ innobase_build_index_translation()

ibool innobase_build_index_translation ( const Table * table,
dict_table_t * ib_table,
INNOBASE_SHARE * share )
static

This function builds a translation table in INNOBASE_SHARE structure for fast index location with mysql array number from its table->key_info structure. This also provides the necessary translation between the key order in mysql key_info and Innodb ib_table->indexes if they are not fully matched with each other. Note we do not have any mutex protecting the translation table building based on the assumption that there is no concurrent index creation/drop and DMLs that requires index lookup. All table handle will be closed before the index creation/drop.

Returns
TRUE if index translation table built successfully
Parameters
tablein: table in MySQL data dictionary
ib_tablein: table in Innodb data dictionary
sharein/out: share structure where index translation table will be constructed in.

Definition at line 3300 of file ha_innodb.cc.

◆ innobase_casedn_str()

UNIV_INTERN void innobase_casedn_str ( char * a)

Makes all characters in a NUL-terminated UTF-8 string lower case.

Parameters
ain/out: string to put in lower case

Definition at line 1368 of file ha_innodb.cc.

◆ innobase_commit_low()

void innobase_commit_low ( trx_t * trx)
static

Commits a transaction in an InnoDB database. in: transaction handle

Commits a transaction in an InnoDB database.

Parameters
trxin: transaction handle

Definition at line 2750 of file ha_innodb.cc.

◆ innobase_convert_from_id()

UNIV_INTERN void innobase_convert_from_id ( const void * cs,
char * to,
const char * from,
ulint len )

Converts an identifier to UTF-8.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

Definition at line 1328 of file ha_innodb.cc.

◆ innobase_convert_from_table_id()

UNIV_INTERN void innobase_convert_from_table_id ( const void * cs,
char * to,
const char * from,
ulint len )

Converts an identifier to a table name.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

Definition at line 1314 of file ha_innodb.cc.

◆ innobase_convert_identifier()

char * innobase_convert_identifier ( char * buf,
ulint buflen,
const char * id,
ulint idlen,
drizzled::Session * session,
ibool file_id )
static

Convert an SQL identifier to the MySQL system_charset_info (UTF-8) and quote it if needed.

Returns
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
idin: identifier to convert
idlenin: length of id, in bytes
sessionin: MySQL connection thread, or NULL
file_idin: TRUE=id is a table or database name; FALSE=id is an UTF-8 string

Definition at line 1732 of file ha_innodb.cc.

◆ innobase_convert_name()

UNIV_INTERN char * innobase_convert_name ( char * buf,
ulint buflen,
const char * id,
ulint idlen,
drizzled::Session * session,
ibool table_id )

Convert a table or index name to the MySQL system_charset_info (UTF-8) and quote it if needed.

Returns
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
idin: identifier to convert
idlenin: length of id, in bytes
sessionin: MySQL connection thread, or NULL
table_idin: TRUE=id is a table or database name; FALSE=id is an index name

Definition at line 1818 of file ha_innodb.cc.

◆ innobase_file_format_name_lookup()

uint innobase_file_format_name_lookup ( const char * format_name)
static

Validate the file format name and return its corresponding id.

Returns
valid file format id in: pointer to file format name

Validate the file format name and return its corresponding id.

Returns
valid file format id
Parameters
format_namein: pointer to file format name

Definition at line 9375 of file ha_innodb.cc.

◆ innobase_file_format_validate_and_set()

int innobase_file_format_validate_and_set ( const char * format_max)
static

Validate the file format check config parameters, as a side effect it sets the srv_max_file_format_at_startup variable.

Returns
the format_id if valid config value, otherwise, return -1 in: parameter value

Validate the file format check config parameters, as a side effect it sets the srv_max_file_format_at_startup variable.

Returns
the format_id if valid config value, otherwise, return -1
Parameters
format_maxin: parameter value

Definition at line 9419 of file ha_innodb.cc.

◆ innobase_get_at_most_n_mbchars()

ulint innobase_get_at_most_n_mbchars ( ulint charset_id,
ulint prefix_len,
ulint data_len,
const char * str )

This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function finds charset information and returns length of prefix_len characters in the index field in bytes.

Returns
number of bytes occupied by the first n characters in: character string

< character length in bytes

< number of characters in prefix

< charset used in the field

Parameters
charset_idin: character set id
prefix_lenin: prefix length in bytes of the index (this has to be divided by mbmaxlen to get the number of CHARACTERS n in the prefix)
data_lenin: length of the string in bytes
strin: character string

Definition at line 9112 of file ha_innodb.cc.

◆ innobase_get_cset_width()

UNIV_INTERN void innobase_get_cset_width ( ulint cset,
ulint * mbminlen,
ulint * mbmaxlen )

Get the variable length bounds of the given character set.

Parameters
csetin: MySQL charset-collation code
mbminlenout: minimum length of a char (in bytes)
mbmaxlenout: maximum length of a char (in bytes)

Definition at line 1287 of file ha_innodb.cc.

◆ innobase_get_int_col_max_value()

uint64_t innobase_get_int_col_max_value ( const Field * field)
static

Get the upper limit of the MySQL integral and floating-point type.

Returns
maximum allowed value for the field
Parameters
fieldin: MySQL field

Definition at line 3187 of file ha_innodb.cc.

◆ innobase_get_mysql_key_number_for_index()

unsigned int innobase_get_mysql_key_number_for_index ( INNOBASE_SHARE * share,
const drizzled::Table * table,
dict_table_t * ib_table,
const dict_index_t * index )
static

Calculates the key number used inside MySQL for an Innobase index. We will first check the "index translation table" for a match of the index to get the index number. If there does not exist an "index translation table", or not able to find the index in the translation table, then we will fall back to the traditional way of looping through dict_index_t list to find a match. In this case, we have to take into account if we generated a default clustered index for the table

Returns
the key number used inside MySQL
Parameters
sharein: share structure for index translation table.
tablein: table in MySQL data dictionary
ib_tablein: table in Innodb data dictionary
indexin: index

Definition at line 7263 of file ha_innodb.cc.

◆ innobase_index_lookup()

dict_index_t * innobase_index_lookup ( INNOBASE_SHARE * share,
uint keynr )
static

This function uses index translation table to quickly locate the requested index structure. Note we do not have mutex protection for the index translatoin table access, it is based on the assumption that there is no concurrent translation table rebuild (fter create/drop index) and DMLs that require index lookup.

Returns
dict_index_t structure for requested index. NULL if fail to locate the index structure.
Parameters
sharein: share structure for index translation table.
keynrin: index number for the requested index

Definition at line 3417 of file ha_innodb.cc.

◆ innobase_index_name_is_reserved()

UNIV_INTERN bool innobase_index_name_is_reserved ( const trx_t * trx,
const KeyInfo * key_info,
ulint num_of_keys )

Definition at line 9688 of file ha_innodb.cc.

◆ innobase_init()

int innobase_init ( module::Context & context)
static

Opens an InnoDB database.

Returns
0 on success, error code on failure

=512

Parameters
contextin: Drizzle Plugin Context

Definition at line 2225 of file ha_innodb.cc.

◆ innobase_isspace()

UNIV_INTERN bool innobase_isspace ( const void * cs,
char char_to_test )

Definition at line 1377 of file ha_innodb.cc.

◆ innobase_map_isolation_level()

ulint innobase_map_isolation_level ( enum_tx_isolation iso)
inlinestatic

Maps a MySQL trx isolation level code to the InnoDB isolation level code

Returns
InnoDB isolation level
Parameters
isoin: MySQL isolation level code

Definition at line 8235 of file ha_innodb.cc.

◆ innobase_match_index_columns()

ibool innobase_match_index_columns ( const KeyInfo * key_info,
const dict_index_t * index_info )
static

This function checks whether the index column information is consistent between KEY info from mysql and that from innodb index.

Returns
TRUE if all column types match.
Parameters
key_infoin: Index info from mysql
index_infoin: Index info from Innodb

Definition at line 3229 of file ha_innodb.cc.

◆ innobase_mysql_cmp()

int innobase_mysql_cmp ( int mysql_type,
uint charset_number,
const unsigned char * a,
unsigned int a_length,
const unsigned char * b,
unsigned int b_length )

InnoDB uses this function to compare two data fields for which the data type is such that we must use MySQL code to compare them. NOTE that the prototype of this function is in rem0cmp.c in InnoDB source code! If you change this function, remember to update the prototype there!

Returns
1, 0, -1, if a is greater, equal, less than b, respectively
Parameters
mysql_typein: MySQL type
charset_numberin: number of the charset
ain: data field
a_lengthin: data field length, not UNIV_SQL_NULL
bin: data field

Definition at line 3944 of file ha_innodb.cc.

◆ innobase_mysql_print_thd()

UNIV_INTERN void innobase_mysql_print_thd ( FILE * f,
drizzled::Session * in_session,
uint max_query_len )

Prints info of a Session object (== user session thread) to the given file.

Parameters
fin: output stream
in_sessionin: pointer to a Drizzle Session object
max_query_lenin: max query length to print, or 0 to use the default max length

Definition at line 1262 of file ha_innodb.cc.

◆ innobase_mysql_tmpfile()

UNIV_INTERN int innobase_mysql_tmpfile ( void )

Creates a temporary file.

Returns
temporary file descriptor, or < 0 on error

Definition at line 1477 of file ha_innodb.cc.

◆ innobase_next_autoinc()

uint64_t innobase_next_autoinc ( uint64_t current,
uint64_t increment,
uint64_t offset,
uint64_t max_value )
static

Compute the next autoinc value.

For MySQL replication the autoincrement values can be partitioned among the nodes. The offset is the start or origin of the autoincrement value for a particular node. For n nodes the increment will be n and the offset will be in the interval [1, n]. The formula tries to allocate the next value for a particular node.

Note: This function is also called with increment set to the number of values we want to reserve for multi-value inserts e.g.,

INSERT INTO T VALUES(), (), ();

innobase_next_autoinc() will be called with increment set to to reserve 3 values for the multi-value INSERT above.

Returns
the next value
Parameters
currentin: Current value
incrementin: increment current by
offsetin: AUTOINC offset
max_valuein: max value for type

Definition at line 1548 of file ha_innodb.cc.

◆ innobase_raw_format()

UNIV_INTERN ulint innobase_raw_format ( const char * data,
ulint data_len,
ulint charset_coll,
char * buf,
ulint buf_size )

Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|DRIZZLE|VARDRIZZLE) using "charset_coll" and writes the result to "buf". The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written
Parameters
datain: raw data
data_lenin: raw data length in bytes
charset_collin: charset collation
bufout: output buffer
buf_sizein: output buffer size in bytes

Definition at line 1516 of file ha_innodb.cc.

◆ innobase_read_from_2_little_endian()

uint innobase_read_from_2_little_endian ( const unsigned char * buf)
inlinestatic

Reads an unsigned integer value < 64k from 2 bytes, in the little-endian storage format.

Returns
value
Parameters
bufin: from where to read

Definition at line 4110 of file ha_innodb.cc.

◆ innobase_release_stat_resources()

void innobase_release_stat_resources ( trx_t * trx)
inlinestatic

Releases possible search latch and InnoDB thread FIFO ticket. These should be released at each SQL statement end, and also when mysqld passes the control to the client. It does no harm to release these also in the middle of an SQL statement.

Parameters
trxin: transaction object

Definition at line 932 of file ha_innodb.cc.

◆ innobase_rename_table()

int innobase_rename_table ( trx_t * trx,
const identifier::Table & from,
const identifier::Table & to,
ibool lock_and_commit )
static

Renames an InnoDB table.

Returns
0 or error code
Parameters
trxin: transaction
lock_and_commitin: TRUE=lock data dictionary and commit

Definition at line 6917 of file ha_innodb.cc.

◆ innobase_rollback_trx()

int innobase_rollback_trx ( trx_t * trx)
static

Rolls back a transaction

Returns
0 or error number
Parameters
trxin: transaction

Definition at line 2966 of file ha_innodb.cc.

◆ innobase_strcasecmp()

UNIV_INTERN int innobase_strcasecmp ( const char * a,
const char * b )

Compares NUL-terminated UTF-8 strings case insensitively.

Returns
0 if a=b, <0 if a<b, >1 if a>b
Parameters
ain: first string to compare
bin: second string to compare

Definition at line 1343 of file ha_innodb.cc.

◆ innobase_trx_allocate()

UNIV_INTERN trx_t * innobase_trx_allocate ( Session * session)

Allocates an InnoDB transaction for a MySQL Cursor object.

Returns
InnoDB transaction handle
Parameters
sessionin: user thread handle

Definition at line 1636 of file ha_innodb.cc.

◆ innobase_trx_init()

void innobase_trx_init ( Session * session,
trx_t * trx )
static

Initializes some fields in an InnoDB transaction object.

Parameters
sessionin: user thread handle
trxin/out: InnoDB transaction handle

Definition at line 1615 of file ha_innodb.cc.

◆ innobase_write_to_2_little_endian()

void innobase_write_to_2_little_endian ( byte * buf,
ulint val )
inlinestatic

Writes an unsigned integer value < 64k to 2 bytes, in the little-endian storage format.

Parameters
bufin: where to store
valin: value to write, must be < 64k

Definition at line 4093 of file ha_innodb.cc.

◆ innodb_adaptive_hash_index_update()

void innodb_adaptive_hash_index_update ( Session * ,
sql_var_t  )
static

Definition at line 1939 of file ha_innodb.cc.

◆ innodb_change_buffering_validate()

int innodb_change_buffering_validate ( Session * ,
set_var * var )
static

Check if it is a valid value of innodb_change_buffering. This function is registered as a callback with MySQL.

Returns
0 for valid innodb_change_buffering

Definition at line 2095 of file ha_innodb.cc.

◆ innodb_commit_concurrency_validate()

int innodb_commit_concurrency_validate ( Session * session,
set_var * var )
static

Definition at line 2010 of file ha_innodb.cc.

◆ innodb_file_format_max_validate()

int innodb_file_format_max_validate ( Session * session,
set_var * var )
static

Check if valid argument to innodb_file_format_max. This function is registered as a callback with MySQL.

Returns
0 for valid file format
Parameters
sessionin: thread handle

Definition at line 2128 of file ha_innodb.cc.

◆ innodb_file_format_name_validate()

int innodb_file_format_name_validate ( Session * ,
set_var * var )
static

Check if it is a valid file format. This function is registered as a callback with MySQL.

Returns
0 for valid file format

Definition at line 2033 of file ha_innodb.cc.

◆ innodb_mutex_show_status()

bool innodb_mutex_show_status ( plugin::StorageEngine * engine,
Session * session,
stat_print_fn * stat_print )
static

Implements the SHOW MUTEX STATUS command.

Returns
true on failure false on success
Parameters
enginein: the innodb StorageEngine
sessionin: the MySQL query thread of the caller
stat_printin: function for printing statistics

Definition at line 8415 of file ha_innodb.cc.

◆ innodb_old_blocks_pct_update()

void innodb_old_blocks_pct_update ( Session * ,
sql_var_t  )
static

Definition at line 1949 of file ha_innodb.cc.

◆ innodb_read_ahead_threshold_update()

void innodb_read_ahead_threshold_update ( Session * ,
sql_var_t  )
static

Definition at line 1980 of file ha_innodb.cc.

◆ innodb_rec_per_key()

ha_rows innodb_rec_per_key ( dict_index_t * index,
ulint i,
ha_rows records )
static

Calculate Record Per Key value. Need to exclude the NULL value if innodb_stats_method is set to "nulls_ignored"

Returns
estimated record per key value
Parameters
indexin: dict_index_t structure
iin: the column we are calculating rec per key
recordsin: estimated total records

Definition at line 7360 of file ha_innodb.cc.

◆ innodb_rollback_segments_update()

void innodb_rollback_segments_update ( Session * ,
sql_var_t  )
static

Definition at line 1959 of file ha_innodb.cc.

◆ innodb_show_status()

bool innodb_show_status ( plugin::StorageEngine * engine,
Session * session,
stat_print_fn * stat_print )
static

Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB Monitor to the client.

Parameters
enginein: the innodb StorageEngine
sessionin: the MySQL query thread of the caller

Definition at line 8329 of file ha_innodb.cc.

◆ innodb_spin_wait_delay_update()

void innodb_spin_wait_delay_update ( Session * ,
sql_var_t  )
static

Definition at line 1970 of file ha_innodb.cc.

◆ innodb_srv_conc_enter_innodb()

void innodb_srv_conc_enter_innodb ( trx_t * trx)
inlinestatic

Save some CPU by testing the value of srv_thread_concurrency in inline functions.

Parameters
trxin: transaction handle

Definition at line 896 of file ha_innodb.cc.

◆ innodb_srv_conc_exit_innodb()

void innodb_srv_conc_exit_innodb ( trx_t * trx)
inlinestatic

Save some CPU by testing the value of srv_thread_concurrency in inline functions.

Parameters
trxin: transaction handle

Definition at line 913 of file ha_innodb.cc.

◆ innodb_stats_method_validate()

int innodb_stats_method_validate ( Session * ,
set_var * var )
static

Definition at line 2061 of file ha_innodb.cc.

◆ innodb_sync_spin_loops_update()

void innodb_sync_spin_loops_update ( Session * ,
sql_var_t  )
static

Definition at line 1965 of file ha_innodb.cc.

◆ innodb_thread_concurrency_update()

void innodb_thread_concurrency_update ( Session * ,
sql_var_t  )
static

Definition at line 1954 of file ha_innodb.cc.

◆ innodb_thread_sleep_delay_update()

void innodb_thread_sleep_delay_update ( Session * ,
sql_var_t  )
static

Definition at line 1975 of file ha_innodb.cc.

◆ io_capacity_update()

void io_capacity_update ( Session * ,
sql_var_t  )
static

Definition at line 1924 of file ha_innodb.cc.

◆ purge_batch_update()

void purge_batch_update ( Session * ,
sql_var_t  )
static

Definition at line 1929 of file ha_innodb.cc.

◆ purge_threads_update()

void purge_threads_update ( Session * ,
sql_var_t  )
static

Definition at line 1934 of file ha_innodb.cc.

◆ read_ahead_validate()

int read_ahead_validate ( Session * ,
set_var * var )
static

Check if argument is a valid value for srv_read_ahead and set it. This function is registered as a callback with MySQL.

Returns
0 for valid read_ahead value

Definition at line 2182 of file ha_innodb.cc.

◆ reset_template()

void reset_template ( row_prebuilt_t * prebuilt)
static

Resets some fields of a prebuilt struct. The template is used in fast retrieval of just those column values MySQL needs in its processing.

Parameters
prebuiltin/out: prebuilt struct

Definition at line 1905 of file ha_innodb.cc.

◆ session_to_trx()

trx_t *& session_to_trx ( Session * session)
inlinestatic

Obtain the InnoDB transaction of a MySQL thread.

Returns
reference to transaction pointer
Parameters
sessionin: Drizzle Session

Definition at line 1026 of file ha_innodb.cc.

◆ set_field_in_record_to_null()

void set_field_in_record_to_null ( Table * table,
Field * field,
char * record )
inlinestatic

Sets a field in a record to SQL NULL. Uses the record format information in table to track the null bit in record.

Parameters
tablein: MySQL table object
fieldin: MySQL field object
recordin: a row in MySQL format

Definition at line 3911 of file ha_innodb.cc.

◆ thd_has_edited_nontrans_tables()

UNIV_INTERN ibool thd_has_edited_nontrans_tables ( drizzled::Session * session)

Returns true if the transaction this thread is processing has edited non-transactional tables. Used by the deadlock detector when deciding which transaction to rollback in case of a deadlock - we try to avoid rolling back transactions that have edited non-transactional tables.

DRIZZLE: Note, we didn't change this name to avoid more ifdef forking in non-Cursor code.

Returns
true if non-transactional tables have been edited
Parameters
sessionin: thread handle (Session*)

Definition at line 958 of file ha_innodb.cc.

◆ thd_is_replication_slave_thread()

UNIV_INTERN ibool thd_is_replication_slave_thread ( drizzled::Session * thd)

Returns true if the thread is the replication thread on the slave server. Used in srv_conc_enter_innodb() to determine if the thread should be allowed to enter InnoDB - the replication thread is treated differently than other threads. Also used in srv_conc_force_exit_innodb().

DRIZZLE: Note, we didn't change this name to avoid more ifdef forking in non-Cursor code.

Returns
true if session is the replication thread
Parameters
thdin: thread handle (Session*)

Definition at line 884 of file ha_innodb.cc.

◆ thd_is_select()

UNIV_INTERN ibool thd_is_select ( const drizzled::Session * session)

Returns true if the thread is executing a SELECT statement.

Returns
true if session is executing SELECT
Parameters
sessionin: thread handle (Session*)

Definition at line 970 of file ha_innodb.cc.

◆ thd_lock_wait_timeout()

UNIV_INTERN ulong thd_lock_wait_timeout ( drizzled::Session * thd)

Returns the lock wait timeout for the current connection.

Returns
the lock wait timeout, in seconds
Parameters
thdin: thread handle (Session*), or NULL to query the global innodb_lock_wait_timeout

Definition at line 997 of file ha_innodb.cc.

◆ thd_set_lock_wait_time()

UNIV_INTERN void thd_set_lock_wait_time ( drizzled::Session * in_session,
ulint value )

Set the time waited for the lock for the current query.

Parameters
in_sessionin: thread handle (THD*)
valuein: time waited for the lock

Definition at line 1012 of file ha_innodb.cc.

◆ thd_supports_xa()

UNIV_INTERN ibool thd_supports_xa ( drizzled::Session * thd)

Returns true if the thread supports XA, global value of innodb_supports_xa if session is NULL.

Returns
true if session has XA support
Parameters
thdin: thread handle (Session*), or NULL to query the global innodb_supports_xa

Definition at line 983 of file ha_innodb.cc.

◆ trx_is_interrupted()

UNIV_INTERN ibool trx_is_interrupted ( trx_t * trx)

Determines if the currently running transaction has been interrupted.

Returns
TRUE if interrupted
Parameters
trxin: transaction

Definition at line 1880 of file ha_innodb.cc.

◆ trx_is_strict()

UNIV_INTERN ibool trx_is_strict ( trx_t * trx)

Determines if the currently running transaction is in strict mode.

Returns
TRUE if strict
Parameters
trxin: transaction

Definition at line 1892 of file ha_innodb.cc.

Variable Documentation

◆ adaptive_flushing_method

string adaptive_flushing_method
static

Definition at line 262 of file ha_innodb.cc.

◆ adaptive_flushing_method_names

const char* adaptive_flushing_method_names[]
static
Initial value:
= {
"native",
"estimate",
"keep_average",
"0",
"1",
"2",
NULL
}

Allowed values of adaptive_flushing_method

Definition at line 355 of file ha_innodb.cc.

◆ adaptive_flushing_method_typelib

TYPELIB adaptive_flushing_method_typelib
static
Initial value:
= {
array_elements(adaptive_flushing_method_names) - 1,
"adaptive_flushing_method_typelib",
}
static const char * adaptive_flushing_method_names[]
Definition ha_innodb.cc:355

Definition at line 366 of file ha_innodb.cc.

◆ buffer_pool_restore_at_startup

uint32_constraint buffer_pool_restore_at_startup
static

Definition at line 222 of file ha_innodb.cc.

◆ checkpoint_age_target

uint32_constraint checkpoint_age_target
static

Definition at line 243 of file ha_innodb.cc.

◆ commit_cond

boost::condition_variable commit_cond
static

Definition at line 152 of file ha_innodb.cc.

◆ commit_cond_m

boost::mutex commit_cond_m
static

Definition at line 153 of file ha_innodb.cc.

◆ commit_threads

ulong commit_threads = 0
static

to force correct commit order in binlog

Definition at line 151 of file ha_innodb.cc.

◆ DRIZZLE_DECLARE_PLUGIN

DRIZZLE_DECLARE_PLUGIN
Initial value:
{
DRIZZLE_VERSION_ID,
"innodb",
INNODB_VERSION_STR,
"Innobase Oy",
"InnoDB storage engine: transactional, row-level locking, foreign keys",
PLUGIN_LICENSE_GPL,
NULL,
init_options
}
DRIZZLE_DECLARE_PLUGIN_END
static int innobase_init(module::Context &context)

Definition at line 9645 of file ha_innodb.cc.

◆ flush_neighbor_pages

binary_constraint flush_neighbor_pages
static

Definition at line 244 of file ha_innodb.cc.

◆ ha_innobase_exts

const char* ha_innobase_exts[]
static
Initial value:
= {
".ibd",
NULL
}

Definition at line 378 of file ha_innodb.cc.

◆ ibuf_accel_rate

ibuf_accel_rate_constraint ibuf_accel_rate
static

Definition at line 242 of file ha_innodb.cc.

◆ ibuf_active_contract

binary_constraint ibuf_active_contract
static

Definition at line 239 of file ha_innodb.cc.

◆ ibuf_max_size

uint64_constraint ibuf_max_size
static

Definition at line 236 of file ha_innodb.cc.

◆ innobase_active_counter

ulong innobase_active_counter = 0
static

Definition at line 317 of file ha_innodb.cc.

◆ innobase_additional_mem_pool_size

additional_mem_pool_constraint innobase_additional_mem_pool_size
static

Definition at line 181 of file ha_innodb.cc.

◆ innobase_buffer_pool_instances

buffer_pool_instances_constraint innobase_buffer_pool_instances
static

Definition at line 187 of file ha_innodb.cc.

◆ innobase_buffer_pool_size

buffer_pool_constraint innobase_buffer_pool_size
static

Definition at line 185 of file ha_innodb.cc.

◆ innobase_change_buffering

string innobase_change_buffering
static

Definition at line 259 of file ha_innodb.cc.

◆ innobase_change_buffering_values

const char* innobase_change_buffering_values[IBUF_USE_COUNT]
static
Initial value:
= {
"none",
"inserts",
"deletes",
"changes",
"purges",
"all"
}

Allowed values of innodb_change_buffering

Definition at line 326 of file ha_innodb.cc.

◆ innobase_commit_concurrency

concurrency_constraint innobase_commit_concurrency
static

Definition at line 213 of file ha_innodb.cc.

◆ innobase_create_status_file

my_bool innobase_create_status_file = FALSE
static

Definition at line 290 of file ha_innodb.cc.

◆ innobase_data_file_path

std::string innobase_data_file_path

Definition at line 256 of file ha_innodb.cc.

◆ innobase_data_home_dir

std::string innobase_data_home_dir

Definition at line 255 of file ha_innodb.cc.

◆ innobase_engine_name

const char innobase_engine_name[] = "InnoDB"
static

Definition at line 717 of file ha_innodb.cc.

◆ innobase_fast_shutdown

trinary_constraint innobase_fast_shutdown
static

Definition at line 272 of file ha_innodb.cc.

◆ innobase_file_format_check

my_bool innobase_file_format_check = TRUE
static

Definition at line 286 of file ha_innodb.cc.

◆ innobase_file_format_max

string innobase_file_format_max
static

Definition at line 267 of file ha_innodb.cc.

◆ innobase_file_format_name

string innobase_file_format_name
static

Definition at line 258 of file ha_innodb.cc.

◆ innobase_force_recovery

force_recovery_constraint innobase_force_recovery

Definition at line 177 of file ha_innodb.cc.

◆ innobase_index_reserve_name

const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX"
static

Definition at line 374 of file ha_innodb.cc.

◆ innobase_log_block_size

log_block_size_constraint innobase_log_block_size
static

Definition at line 195 of file ha_innodb.cc.

◆ innobase_log_buffer_size

log_buffer_constraint innobase_log_buffer_size
static

Definition at line 179 of file ha_innodb.cc.

◆ innobase_log_file_size

log_file_constraint innobase_log_file_size
static

Definition at line 218 of file ha_innodb.cc.

◆ innobase_log_files_in_group

log_files_in_group_constraint innobase_log_files_in_group
static

Definition at line 175 of file ha_innodb.cc.

◆ innobase_log_group_home_dir

std::string innobase_log_group_home_dir

Definition at line 257 of file ha_innodb.cc.

◆ innobase_mirrored_log_groups

mirrored_log_groups_constraint innobase_mirrored_log_groups
static

Definition at line 173 of file ha_innodb.cc.

◆ innobase_old_blocks_pct

old_blocks_constraint innobase_old_blocks_pct
static

Definition at line 227 of file ha_innodb.cc.

◆ innobase_open_files

open_files_constraint innobase_open_files
static

Definition at line 171 of file ha_innodb.cc.

◆ innobase_open_tables

hash_table_t* innobase_open_tables
static

Definition at line 319 of file ha_innodb.cc.

◆ innobase_page_size

page_size_constraint innobase_page_size
static

Definition at line 191 of file ha_innodb.cc.

◆ innobase_read_io_threads

io_threads_constraint innobase_read_io_threads
static

Definition at line 209 of file ha_innodb.cc.

◆ innobase_rollback_on_timeout

my_bool innobase_rollback_on_timeout = FALSE
static

Definition at line 289 of file ha_innodb.cc.

◆ innobase_rollback_segments

rollback_segments_constraint innobase_rollback_segments
static

Definition at line 249 of file ha_innodb.cc.

◆ innobase_share_mutex

boost::mutex innobase_share_mutex
static

to protect innobase_open_files

Definition at line 148 of file ha_innodb.cc.

◆ innobase_thread_concurrency

concurrency_constraint innobase_thread_concurrency
static

Definition at line 214 of file ha_innodb.cc.

◆ innobase_use_checksums

my_bool innobase_use_checksums = TRUE
static

Definition at line 288 of file ha_innodb.cc.

◆ innobase_use_doublewrite

my_bool innobase_use_doublewrite = TRUE
static

Definition at line 287 of file ha_innodb.cc.

◆ innobase_use_replication_log

bool innobase_use_replication_log
static

Definition at line 291 of file ha_innodb.cc.

◆ innobase_write_io_threads

io_threads_constraint innobase_write_io_threads
static

Definition at line 210 of file ha_innodb.cc.

◆ innodb_auto_extend_increment

autoextend_constraint innodb_auto_extend_increment
static

Definition at line 183 of file ha_innodb.cc.

◆ innodb_concurrency_tickets

uint32_nonzero_constraint innodb_concurrency_tickets
static

Definition at line 215 of file ha_innodb.cc.

◆ innodb_engine_ptr

plugin::XaStorageEngine* innodb_engine_ptr = NULL
static

Definition at line 168 of file ha_innodb.cc.

◆ innodb_flush_log_at_trx_commit

trinary_constraint innodb_flush_log_at_trx_commit
static

Definition at line 203 of file ha_innodb.cc.

◆ innodb_inited

bool innodb_inited = 0
static

Definition at line 154 of file ha_innodb.cc.

◆ innodb_io_capacity

io_capacity_constraint innodb_io_capacity
static

Definition at line 197 of file ha_innodb.cc.

◆ innodb_max_dirty_pages_pct

max_dirty_pages_constraint innodb_max_dirty_pages_pct
static

Definition at line 205 of file ha_innodb.cc.

◆ innodb_max_purge_lag

uint64_constraint innodb_max_purge_lag
static

Definition at line 206 of file ha_innodb.cc.

◆ innodb_n_purge_threads

purge_threads_constraint innodb_n_purge_threads
static

Definition at line 201 of file ha_innodb.cc.

◆ innodb_purge_batch_size

purge_batch_constraint innodb_purge_batch_size
static

Definition at line 199 of file ha_innodb.cc.

◆ innodb_read_ahead_threshold

read_ahead_threshold_constraint innodb_read_ahead_threshold
static

Definition at line 234 of file ha_innodb.cc.

◆ innodb_replication_delay

uint64_constraint innodb_replication_delay
static

Definition at line 220 of file ha_innodb.cc.

◆ innodb_spin_wait_delay

uint32_constraint innodb_spin_wait_delay
static

Definition at line 230 of file ha_innodb.cc.

◆ innodb_stats_method

string innodb_stats_method
static

Definition at line 309 of file ha_innodb.cc.

◆ innodb_stats_method_names

const char* innodb_stats_method_names[]
static
Initial value:
= {
"nulls_equal",
"nulls_unequal",
"nulls_ignored",
NULL
}

Possible values for system variable "innodb_stats_method". The values are defined the same as its corresponding MyISAM system variable "myisam_stats_method"(see "myisam_stats_method_names"), for better usability

Definition at line 302 of file ha_innodb.cc.

◆ innodb_stats_sample_pages

uint64_nonzero_constraint innodb_stats_sample_pages
static

Definition at line 207 of file ha_innodb.cc.

◆ innodb_status_variables

drizzle_show_var innodb_status_variables[]
static

Definition at line 728 of file ha_innodb.cc.

◆ innodb_sync_spin_loops

uint32_constraint innodb_sync_spin_loops
static

Definition at line 229 of file ha_innodb.cc.

◆ innodb_thread_sleep_delay

uint32_constraint innodb_thread_sleep_delay
static

Definition at line 231 of file ha_innodb.cc.

◆ internal_innobase_data_file_path

char* internal_innobase_data_file_path = NULL
static

Definition at line 297 of file ha_innodb.cc.

◆ lock_wait_timeout

lock_wait_constraint lock_wait_timeout
static

Definition at line 295 of file ha_innodb.cc.

◆ read_ahead

string read_ahead
static

Definition at line 261 of file ha_innodb.cc.

◆ read_ahead_names

const char* read_ahead_names[]
static
Initial value:
= {
"none",
"random",
"linear",
"both",
"0",
"1",
"2",
"3",
NULL
}

Allowed values of read_ahead

Definition at line 336 of file ha_innodb.cc.

◆ read_ahead_typelib

TYPELIB read_ahead_typelib
static
Initial value:
= {
array_elements(read_ahead_names) - 1, "read_ahead_typelib",
}
static const char * read_ahead_names[]
Definition ha_innodb.cc:336

Definition at line 349 of file ha_innodb.cc.

◆ strict_mode

bool strict_mode
static

Definition at line 293 of file ha_innodb.cc.

◆ support_xa

bool support_xa
static

Definition at line 292 of file ha_innodb.cc.

◆ sysvar_transaction_log_use_replicator

string sysvar_transaction_log_use_replicator
static

Definition at line 246 of file ha_innodb.cc.