|
drizzle
C++ MySQL-protocol-compatible database server
|
#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 |
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 | |
| #define EQ_CURRENT_SESSION | ( | session | ) |
Definition at line 165 of file ha_innodb.cc.
| #define INNOBASE_WAKE_INTERVAL 32 |
Definition at line 316 of file ha_innodb.cc.
| #define INSIDE_HA_INNOBASE_CC |
Definition at line 156 of file ha_innodb.cc.
| typedef constrained_check<size_t, SIZE_MAX, 512*1024, 1024> additional_mem_pool_constraint |
Definition at line 180 of file ha_innodb.cc.
| typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint |
Definition at line 182 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 1, 0> binary_constraint |
Definition at line 238 of file ha_innodb.cc.
| typedef constrained_check<size_t, SIZE_MAX, 33554432, 1048576> buffer_pool_constraint |
Definition at line 184 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, MAX_BUFFER_POOLS, 1> buffer_pool_instances_constraint |
Definition at line 186 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 1000, 0> concurrency_constraint |
Definition at line 212 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 6, 0> force_recovery_constraint |
Definition at line 176 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 999999999, 100> ibuf_accel_rate_constraint |
Definition at line 241 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, UINT32_MAX, 100> io_capacity_constraint |
Definition at line 196 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 64, 1> io_threads_constraint |
Definition at line 208 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 1024*1024*1024, 1> lock_wait_constraint |
Definition at line 294 of file ha_innodb.cc.
| 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.
| typedef constrained_check<size_t, SIZE_MAX, 256*1024, 1024> log_buffer_constraint |
Definition at line 178 of file ha_innodb.cc.
| typedef constrained_check<int64_t, INT64_MAX, 1024*1024, 1024*1024> log_file_constraint |
Definition at line 217 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 100, 2> log_files_in_group_constraint |
Definition at line 174 of file ha_innodb.cc.
| typedef constrained_check<unsigned int, 99, 0> max_dirty_pages_constraint |
Definition at line 204 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 10, 1> mirrored_log_groups_constraint |
Definition at line 172 of file ha_innodb.cc.
| 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.
| typedef constrained_check<uint32_t, UINT32_MAX, 10> open_files_constraint |
Definition at line 170 of file ha_innodb.cc.
| 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.
| typedef constrained_check<uint32_t, 5000, 1> purge_batch_constraint |
Definition at line 198 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 1, 0> purge_threads_constraint |
Definition at line 200 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 64, 0> read_ahead_threshold_constraint |
Definition at line 233 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, TRX_SYS_N_RSEGS, 1> rollback_segments_constraint |
Definition at line 248 of file ha_innodb.cc.
| typedef constrained_check<uint32_t, 2, 0> trinary_constraint |
Definition at line 202 of file ha_innodb.cc.
Check if argument is a valid value for srv_adaptive_flushing_method and set it. This function is registered as a callback with MySQL.
Definition at line 2204 of file ha_innodb.cc.
| void align_value | ( | T & | value, |
| size_t | align_val = 1024 ) |
Definition at line 1914 of file ha_innodb.cc.
|
static |
Definition at line 1919 of file ha_innodb.cc.
|
static |
Definition at line 1985 of file ha_innodb.cc.
|
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.
| prebuilt | in/out: prebuilt struct |
| table | in: MySQL table |
| templ_type | in: ROW_MYSQL_WHOLE_ROW or ROW_DRIZZLE_REC_FIELDS |
Definition at line 4353 of file ha_innodb.cc.
|
static |
Checks which fields have changed in a row and stores information of them to an update vector.
| uvect | in/out: update vector |
| old_row | in: old row in MySQL format |
| new_row | in: new row in MySQL format |
| table | in: table in MySQL data dictionary |
| upd_buff | in: buffer to use |
| buff_len | in: buffer length |
| prebuilt | in: InnoDB prebuilt struct |
Definition at line 4857 of file ha_innodb.cc.
|
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.
| session | in: user thread handle |
Definition at line 1661 of file ha_innodb.cc.
|
static |
Definition at line 2000 of file ha_innodb.cc.
| 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.
| error | in: InnoDB error code |
| flags | in: InnoDB table flags, or 0 |
| session | in: user thread handle or NULL |
Definition at line 1118 of file ha_innodb.cc.
|
inlinestatic |
Converts a search mode flag understood by MySQL to a flag understood by InnoDB.
Definition at line 5279 of file ha_innodb.cc.
|
static |
Creates an index to an InnoDB table when the user has defined no primary index.
| trx | in: InnoDB transaction handle |
| flags | in: InnoDB table flags |
| table_name | in: table name |
Definition at line 6264 of file ha_innodb.cc.
|
static |
Creates an index in an InnoDB database.
| trx | in: InnoDB transaction handle |
| form | in: information on table columns and indexes |
| flags | in: InnoDB table flags |
| table_name | in: table name |
| key_num | in: index number |
Definition at line 6137 of file ha_innodb.cc.
|
static |
Creates a table definition to an InnoDB database.
| trx | in: InnoDB transaction handle |
| form | in: information on table columns and indexes |
| table_name | in: table name |
| path_of_temp_table | in: 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 |
| flags | in: table flags |
Definition at line 5978 of file ha_innodb.cc.
Checks if a field in a record is SQL NULL. Uses the record format information in table to track the null bit in record.
| table | in: MySQL table object |
| field | in: MySQL field object |
| record | in: a row in MySQL format |
Definition at line 3882 of file ha_innodb.cc.
|
static |
Definition at line 2005 of file ha_innodb.cc.
|
static |
Definition at line 8644 of file ha_innodb.cc.
Gets field offset for a field in a table.
| table | in: MySQL table object |
| field | in: MySQL field object |
Definition at line 3868 of file ha_innodb.cc.
| 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'.
| unsigned_flag | out: DATA_UNSIGNED if an 'unsigned type'; at least ENUM and SET, and unsigned integer types are 'unsigned types' |
| f | in: MySQL Field |
Definition at line 4015 of file ha_innodb.cc.
|
static |
Handling the shared INNOBASE_SHARE structure that is needed to provide table locking.
Definition at line 8610 of file ha_innodb.cc.
|
static |
Definition at line 1995 of file ha_innodb.cc.
|
static |
Definition at line 1990 of file ha_innodb.cc.
|
static |
Definition at line 9437 of file ha_innodb.cc.
|
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.
| const char * innobase_basename | ( | const char * | path_name | ) |
Strip dir name from a full path name and return only the file name
| path_name | in: full path name |
Definition at line 1355 of file ha_innodb.cc.
|
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.
| table | in: table in MySQL data dictionary |
| ib_table | in: table in Innodb data dictionary |
| share | in/out: share structure where index translation table will be constructed in. |
Definition at line 3300 of file ha_innodb.cc.
| UNIV_INTERN void innobase_casedn_str | ( | char * | a | ) |
Makes all characters in a NUL-terminated UTF-8 string lower case.
| a | in/out: string to put in lower case |
Definition at line 1368 of file ha_innodb.cc.
|
static |
Commits a transaction in an InnoDB database. in: transaction handle
Commits a transaction in an InnoDB database.
| trx | in: transaction handle |
Definition at line 2750 of file ha_innodb.cc.
| UNIV_INTERN void innobase_convert_from_id | ( | const void * | cs, |
| char * | to, | ||
| const char * | from, | ||
| ulint | len ) |
Converts an identifier to UTF-8.
| cs | in: the 'from' character set |
| to | out: converted identifier |
| from | in: identifier to convert |
| len | in: length of 'to', in bytes |
Definition at line 1328 of file ha_innodb.cc.
| 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.
| cs | in: the 'from' character set |
| to | out: converted identifier |
| from | in: identifier to convert |
| len | in: length of 'to', in bytes |
Definition at line 1314 of file ha_innodb.cc.
|
static |
Convert an SQL identifier to the MySQL system_charset_info (UTF-8) and quote it if needed.
| buf | out: buffer for converted identifier |
| buflen | in: length of buf, in bytes |
| id | in: identifier to convert |
| idlen | in: length of id, in bytes |
| session | in: MySQL connection thread, or NULL |
| file_id | in: TRUE=id is a table or database name; FALSE=id is an UTF-8 string |
Definition at line 1732 of file ha_innodb.cc.
| 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.
| buf | out: buffer for converted identifier |
| buflen | in: length of buf, in bytes |
| id | in: identifier to convert |
| idlen | in: length of id, in bytes |
| session | in: MySQL connection thread, or NULL |
| table_id | in: TRUE=id is a table or database name; FALSE=id is an index name |
Definition at line 1818 of file ha_innodb.cc.
|
static |
Validate the file format name and return its corresponding id.
Validate the file format name and return its corresponding id.
| format_name | in: pointer to file format name |
Definition at line 9375 of file ha_innodb.cc.
|
static |
Validate the file format check config parameters, as a side effect it sets the srv_max_file_format_at_startup variable.
Validate the file format check config parameters, as a side effect it sets the srv_max_file_format_at_startup variable.
| format_max | in: parameter value |
Definition at line 9419 of file ha_innodb.cc.
| 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.
< character length in bytes
< number of characters in prefix
< charset used in the field
| charset_id | in: character set id |
| prefix_len | in: 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_len | in: length of the string in bytes |
| str | in: character string |
Definition at line 9112 of file ha_innodb.cc.
| UNIV_INTERN void innobase_get_cset_width | ( | ulint | cset, |
| ulint * | mbminlen, | ||
| ulint * | mbmaxlen ) |
Get the variable length bounds of the given character set.
| cset | in: MySQL charset-collation code |
| mbminlen | out: minimum length of a char (in bytes) |
| mbmaxlen | out: maximum length of a char (in bytes) |
Definition at line 1287 of file ha_innodb.cc.
|
static |
Get the upper limit of the MySQL integral and floating-point type.
| field | in: MySQL field |
Definition at line 3187 of file ha_innodb.cc.
|
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
| share | in: share structure for index translation table. |
| table | in: table in MySQL data dictionary |
| ib_table | in: table in Innodb data dictionary |
| index | in: index |
Definition at line 7263 of file ha_innodb.cc.
|
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.
| share | in: share structure for index translation table. |
| keynr | in: index number for the requested index |
Definition at line 3417 of file ha_innodb.cc.
| 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.
|
static |
Opens an InnoDB database.
=512
| context | in: Drizzle Plugin Context |
Definition at line 2225 of file ha_innodb.cc.
| UNIV_INTERN bool innobase_isspace | ( | const void * | cs, |
| char | char_to_test ) |
Definition at line 1377 of file ha_innodb.cc.
|
inlinestatic |
Maps a MySQL trx isolation level code to the InnoDB isolation level code
| iso | in: MySQL isolation level code |
Definition at line 8235 of file ha_innodb.cc.
|
static |
This function checks whether the index column information is consistent between KEY info from mysql and that from innodb index.
| key_info | in: Index info from mysql |
| index_info | in: Index info from Innodb |
Definition at line 3229 of file ha_innodb.cc.
| 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!
| mysql_type | in: MySQL type |
| charset_number | in: number of the charset |
| a | in: data field |
| a_length | in: data field length, not UNIV_SQL_NULL |
| b | in: data field |
Definition at line 3944 of file ha_innodb.cc.
| 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.
| f | in: output stream |
| in_session | in: pointer to a Drizzle Session object |
| max_query_len | in: max query length to print, or 0 to use the default max length |
Definition at line 1262 of file ha_innodb.cc.
| UNIV_INTERN int innobase_mysql_tmpfile | ( | void | ) |
Creates a temporary file.
Definition at line 1477 of file ha_innodb.cc.
|
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.
| current | in: Current value |
| increment | in: increment current by |
| offset | in: AUTOINC offset |
| max_value | in: max value for type |
Definition at line 1548 of file ha_innodb.cc.
| 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).
| data | in: raw data |
| data_len | in: raw data length in bytes |
| charset_coll | in: charset collation |
| buf | out: output buffer |
| buf_size | in: output buffer size in bytes |
Definition at line 1516 of file ha_innodb.cc.
|
inlinestatic |
Reads an unsigned integer value < 64k from 2 bytes, in the little-endian storage format.
| buf | in: from where to read |
Definition at line 4110 of file ha_innodb.cc.
|
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.
| trx | in: transaction object |
Definition at line 932 of file ha_innodb.cc.
|
static |
Renames an InnoDB table.
| trx | in: transaction |
| lock_and_commit | in: TRUE=lock data dictionary and commit |
Definition at line 6917 of file ha_innodb.cc.
|
static |
Rolls back a transaction
| trx | in: transaction |
Definition at line 2966 of file ha_innodb.cc.
| UNIV_INTERN int innobase_strcasecmp | ( | const char * | a, |
| const char * | b ) |
Compares NUL-terminated UTF-8 strings case insensitively.
| a | in: first string to compare |
| b | in: second string to compare |
Definition at line 1343 of file ha_innodb.cc.
| UNIV_INTERN trx_t * innobase_trx_allocate | ( | Session * | session | ) |
Allocates an InnoDB transaction for a MySQL Cursor object.
| session | in: user thread handle |
Definition at line 1636 of file ha_innodb.cc.
|
static |
Initializes some fields in an InnoDB transaction object.
| session | in: user thread handle |
| trx | in/out: InnoDB transaction handle |
Definition at line 1615 of file ha_innodb.cc.
|
inlinestatic |
Writes an unsigned integer value < 64k to 2 bytes, in the little-endian storage format.
| buf | in: where to store |
| val | in: value to write, must be < 64k |
Definition at line 4093 of file ha_innodb.cc.
|
static |
Definition at line 1939 of file ha_innodb.cc.
Check if it is a valid value of innodb_change_buffering. This function is registered as a callback with MySQL.
Definition at line 2095 of file ha_innodb.cc.
Definition at line 2010 of file ha_innodb.cc.
Check if valid argument to innodb_file_format_max. This function is registered as a callback with MySQL.
| session | in: thread handle |
Definition at line 2128 of file ha_innodb.cc.
Check if it is a valid file format. This function is registered as a callback with MySQL.
Definition at line 2033 of file ha_innodb.cc.
|
static |
Implements the SHOW MUTEX STATUS command.
| engine | in: the innodb StorageEngine |
| session | in: the MySQL query thread of the caller |
| stat_print | in: function for printing statistics |
Definition at line 8415 of file ha_innodb.cc.
|
static |
Definition at line 1949 of file ha_innodb.cc.
|
static |
Definition at line 1980 of file ha_innodb.cc.
|
static |
Calculate Record Per Key value. Need to exclude the NULL value if innodb_stats_method is set to "nulls_ignored"
| index | in: dict_index_t structure |
| i | in: the column we are calculating rec per key |
| records | in: estimated total records |
Definition at line 7360 of file ha_innodb.cc.
|
static |
Definition at line 1959 of file ha_innodb.cc.
|
static |
Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB Monitor to the client.
| engine | in: the innodb StorageEngine |
| session | in: the MySQL query thread of the caller |
Definition at line 8329 of file ha_innodb.cc.
|
static |
Definition at line 1970 of file ha_innodb.cc.
|
inlinestatic |
Save some CPU by testing the value of srv_thread_concurrency in inline functions.
| trx | in: transaction handle |
Definition at line 896 of file ha_innodb.cc.
|
inlinestatic |
Save some CPU by testing the value of srv_thread_concurrency in inline functions.
| trx | in: transaction handle |
Definition at line 913 of file ha_innodb.cc.
Definition at line 2061 of file ha_innodb.cc.
|
static |
Definition at line 1965 of file ha_innodb.cc.
|
static |
Definition at line 1954 of file ha_innodb.cc.
|
static |
Definition at line 1975 of file ha_innodb.cc.
|
static |
Definition at line 1924 of file ha_innodb.cc.
|
static |
Definition at line 1929 of file ha_innodb.cc.
|
static |
Definition at line 1934 of file ha_innodb.cc.
Check if argument is a valid value for srv_read_ahead and set it. This function is registered as a callback with MySQL.
Definition at line 2182 of file ha_innodb.cc.
|
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.
| prebuilt | in/out: prebuilt struct |
Definition at line 1905 of file ha_innodb.cc.
|
inlinestatic |
Obtain the InnoDB transaction of a MySQL thread.
| session | in: Drizzle Session |
Definition at line 1026 of file ha_innodb.cc.
Sets a field in a record to SQL NULL. Uses the record format information in table to track the null bit in record.
| table | in: MySQL table object |
| field | in: MySQL field object |
| record | in: a row in MySQL format |
Definition at line 3911 of file ha_innodb.cc.
| 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.
| session | in: thread handle (Session*) |
Definition at line 958 of file ha_innodb.cc.
| 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.
| thd | in: thread handle (Session*) |
Definition at line 884 of file ha_innodb.cc.
| UNIV_INTERN ibool thd_is_select | ( | const drizzled::Session * | session | ) |
Returns true if the thread is executing a SELECT statement.
| session | in: thread handle (Session*) |
Definition at line 970 of file ha_innodb.cc.
| UNIV_INTERN ulong thd_lock_wait_timeout | ( | drizzled::Session * | thd | ) |
Returns the lock wait timeout for the current connection.
| thd | in: thread handle (Session*), or NULL to query the global innodb_lock_wait_timeout |
Definition at line 997 of file ha_innodb.cc.
| 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.
| in_session | in: thread handle (THD*) |
| value | in: time waited for the lock |
Definition at line 1012 of file ha_innodb.cc.
| 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.
| thd | in: thread handle (Session*), or NULL to query the global innodb_supports_xa |
Definition at line 983 of file ha_innodb.cc.
| UNIV_INTERN ibool trx_is_interrupted | ( | trx_t * | trx | ) |
Determines if the currently running transaction has been interrupted.
| trx | in: transaction |
Definition at line 1880 of file ha_innodb.cc.
| UNIV_INTERN ibool trx_is_strict | ( | trx_t * | trx | ) |
Determines if the currently running transaction is in strict mode.
| trx | in: transaction |
Definition at line 1892 of file ha_innodb.cc.
|
static |
Definition at line 262 of file ha_innodb.cc.
|
static |
Allowed values of adaptive_flushing_method
Definition at line 355 of file ha_innodb.cc.
|
static |
Definition at line 366 of file ha_innodb.cc.
|
static |
Definition at line 222 of file ha_innodb.cc.
|
static |
Definition at line 243 of file ha_innodb.cc.
|
static |
Definition at line 152 of file ha_innodb.cc.
|
static |
Definition at line 153 of file ha_innodb.cc.
|
static |
to force correct commit order in binlog
Definition at line 151 of file ha_innodb.cc.
| DRIZZLE_DECLARE_PLUGIN |
Definition at line 9645 of file ha_innodb.cc.
|
static |
Definition at line 244 of file ha_innodb.cc.
|
static |
Definition at line 378 of file ha_innodb.cc.
|
static |
Definition at line 242 of file ha_innodb.cc.
|
static |
Definition at line 239 of file ha_innodb.cc.
|
static |
Definition at line 236 of file ha_innodb.cc.
|
static |
Definition at line 317 of file ha_innodb.cc.
|
static |
Definition at line 181 of file ha_innodb.cc.
|
static |
Definition at line 187 of file ha_innodb.cc.
|
static |
Definition at line 185 of file ha_innodb.cc.
|
static |
Definition at line 259 of file ha_innodb.cc.
|
static |
Allowed values of innodb_change_buffering
Definition at line 326 of file ha_innodb.cc.
|
static |
Definition at line 213 of file ha_innodb.cc.
|
static |
Definition at line 290 of file ha_innodb.cc.
| std::string innobase_data_file_path |
Definition at line 256 of file ha_innodb.cc.
| std::string innobase_data_home_dir |
Definition at line 255 of file ha_innodb.cc.
|
static |
Definition at line 717 of file ha_innodb.cc.
|
static |
Definition at line 272 of file ha_innodb.cc.
|
static |
Definition at line 286 of file ha_innodb.cc.
|
static |
Definition at line 267 of file ha_innodb.cc.
|
static |
Definition at line 258 of file ha_innodb.cc.
| force_recovery_constraint innobase_force_recovery |
Definition at line 177 of file ha_innodb.cc.
|
static |
Definition at line 374 of file ha_innodb.cc.
|
static |
Definition at line 195 of file ha_innodb.cc.
|
static |
Definition at line 179 of file ha_innodb.cc.
|
static |
Definition at line 218 of file ha_innodb.cc.
|
static |
Definition at line 175 of file ha_innodb.cc.
| std::string innobase_log_group_home_dir |
Definition at line 257 of file ha_innodb.cc.
|
static |
Definition at line 173 of file ha_innodb.cc.
|
static |
Definition at line 227 of file ha_innodb.cc.
|
static |
Definition at line 171 of file ha_innodb.cc.
|
static |
Definition at line 319 of file ha_innodb.cc.
|
static |
Definition at line 191 of file ha_innodb.cc.
|
static |
Definition at line 209 of file ha_innodb.cc.
|
static |
Definition at line 289 of file ha_innodb.cc.
|
static |
Definition at line 249 of file ha_innodb.cc.
|
static |
to protect innobase_open_files
Definition at line 148 of file ha_innodb.cc.
|
static |
Definition at line 214 of file ha_innodb.cc.
|
static |
Definition at line 288 of file ha_innodb.cc.
|
static |
Definition at line 287 of file ha_innodb.cc.
|
static |
Definition at line 291 of file ha_innodb.cc.
|
static |
Definition at line 210 of file ha_innodb.cc.
|
static |
Definition at line 183 of file ha_innodb.cc.
|
static |
Definition at line 215 of file ha_innodb.cc.
|
static |
Definition at line 168 of file ha_innodb.cc.
|
static |
Definition at line 203 of file ha_innodb.cc.
|
static |
Definition at line 154 of file ha_innodb.cc.
|
static |
Definition at line 197 of file ha_innodb.cc.
|
static |
Definition at line 205 of file ha_innodb.cc.
|
static |
Definition at line 206 of file ha_innodb.cc.
|
static |
Definition at line 201 of file ha_innodb.cc.
|
static |
Definition at line 199 of file ha_innodb.cc.
|
static |
Definition at line 234 of file ha_innodb.cc.
|
static |
Definition at line 220 of file ha_innodb.cc.
|
static |
Definition at line 230 of file ha_innodb.cc.
|
static |
Definition at line 309 of file ha_innodb.cc.
|
static |
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.
|
static |
Definition at line 207 of file ha_innodb.cc.
|
static |
Definition at line 728 of file ha_innodb.cc.
|
static |
Definition at line 229 of file ha_innodb.cc.
|
static |
Definition at line 231 of file ha_innodb.cc.
|
static |
Definition at line 297 of file ha_innodb.cc.
|
static |
Definition at line 295 of file ha_innodb.cc.
|
static |
Definition at line 261 of file ha_innodb.cc.
|
static |
Allowed values of read_ahead
Definition at line 336 of file ha_innodb.cc.
|
static |
Definition at line 349 of file ha_innodb.cc.
|
static |
Definition at line 293 of file ha_innodb.cc.
|
static |
Definition at line 292 of file ha_innodb.cc.
|
static |
Definition at line 246 of file ha_innodb.cc.