#include <ft_global.h>#include <keycache.h>Include dependency graph for handler.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define CHF_CREATE_FLAG 0 |
| #define CHF_DELETE_FLAG 1 |
| #define CHF_RENAME_FLAG 2 |
| #define COMPATIBLE_DATA_NO 1 |
Definition at line 319 of file handler.h.
Referenced by handler::check_if_incompatible_data(), ha_myisammrg::check_if_incompatible_data(), ha_myisam::check_if_incompatible_data(), and ha_heap::check_if_incompatible_data().
| #define COMPATIBLE_DATA_YES 0 |
Definition at line 318 of file handler.h.
Referenced by ha_tina::check_if_incompatible_data(), ha_myisam::check_if_incompatible_data(), and ha_heap::check_if_incompatible_data().
| #define HA_ABORT_IF_LOCKED 128 |
| #define HA_ADMIN_ALREADY_DONE 1 |
Definition at line 35 of file handler.h.
Referenced by ha_myisam::analyze(), ha_myisam::check(), mysql_admin_table(), and ha_myisam::repair().
| #define HA_ADMIN_CORRUPT -3 |
Definition at line 39 of file handler.h.
Referenced by ha_myisam::analyze(), ha_myisam::assign_to_keycache(), ha_tina::check(), ha_archive::check(), ha_myisam::check(), and mysql_admin_table().
| #define HA_ADMIN_FAILED -2 |
Definition at line 38 of file handler.h.
Referenced by ha_myisam::assign_to_keycache(), ha_myisam::backup(), mysql_admin_table(), ha_myisam::preload_keys(), ha_myisam::repair(), and ha_myisam::restore().
| #define HA_ADMIN_INTERNAL_ERROR -4 |
Definition at line 40 of file handler.h.
Referenced by ha_myisam::check(), ha_myisam::optimize(), and ha_myisam::repair().
| #define HA_ADMIN_INVALID -5 |
Definition at line 41 of file handler.h.
Referenced by ha_myisam::backup(), mysql_admin_table(), and ha_myisam::restore().
| #define HA_ADMIN_NEEDS_ALTER -11 |
Definition at line 47 of file handler.h.
Referenced by handler::check_old_types(), and mysql_admin_table().
| #define HA_ADMIN_NEEDS_CHECK -12 |
Definition at line 48 of file handler.h.
Referenced by handler::ha_check(), and handler::ha_check_for_upgrade().
| #define HA_ADMIN_NEEDS_UPGRADE -10 |
| #define HA_ADMIN_NOT_BASE_TABLE -9 |
| #define HA_ADMIN_NOT_IMPLEMENTED -1 |
Definition at line 37 of file handler.h.
Referenced by handler::analyze(), handler::assign_to_keycache(), handler::backup(), handler::check(), mysql_admin_table(), mysql_alter_tablespace(), handler::optimize(), handler::preload_keys(), handler::repair(), handler::restore(), and view_checksum().
| #define HA_ADMIN_OK 0 |
Definition at line 36 of file handler.h.
Referenced by ha_myisam::analyze(), ha_myisam::assign_to_keycache(), ha_myisam::backup(), ha_tina::check(), ha_archive::check(), ha_myisam::check(), ha_myisam::enable_indexes(), mysql_admin_table(), ha_myisam::preload_keys(), ha_tina::repair(), ha_myisam::repair(), and view_checksum().
| #define HA_ADMIN_REJECT -6 |
| #define HA_ADMIN_TRY_ALTER -7 |
| #define HA_ADMIN_WRONG_CHECKSUM -8 |
| #define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30) |
| #define HA_AUTO_PART_KEY (1 << 11) |
Definition at line 80 of file handler.h.
Referenced by ha_blackhole::table_flags(), ha_myisammrg::table_flags(), and ha_federated::table_flags().
| #define ha_binlog_end | ( | a | ) | do {} while (0) |
| #define ha_binlog_index_purge_file | ( | a, | |||
| b | ) | do {} while (0) |
| #define HA_BLOCK_LOCK 256 |
| #define HA_CACHE_TBL_ASKTRANSACT 2 |
| #define HA_CACHE_TBL_NOCACHE 1 |
| #define HA_CACHE_TBL_NONTRANSACT 0 |
| #define HA_CAN_BIT_FIELD (1 << 28) |
Definition at line 114 of file handler.h.
Referenced by mysql_prepare_table(), ha_archive::table_flags(), and ha_myisammrg::table_flags().
| #define HA_CAN_FULLTEXT (1 << 21) |
Definition at line 107 of file handler.h.
Referenced by Item_func_match::fix_fields(), and ha_blackhole::table_flags().
| #define HA_CAN_GEOMETRY (1 << 4) |
Definition at line 64 of file handler.h.
Referenced by sp_head::fill_field_definition(), prepare_create_field(), ha_blackhole::table_flags(), and ha_archive::table_flags().
| #define HA_CAN_INDEX_BLOBS (1 << 10) |
Definition at line 79 of file handler.h.
Referenced by ha_blackhole::table_flags(), ha_myisammrg::table_flags(), and ha_federated::table_flags().
| #define HA_CAN_INSERT_DELAYED (1 << 14) |
Definition at line 87 of file handler.h.
Referenced by handle_delayed_insert(), mysql_test_insert(), ha_blackhole::table_flags(), ha_archive::table_flags(), ha_myisammrg::table_flags(), and ha_heap::table_flags().
| #define HA_CAN_SQL_HANDLER (1 << 22) |
Definition at line 108 of file handler.h.
Referenced by mysql_ha_open(), and ha_blackhole::table_flags().
| #define HA_CHECK_DUP (HA_CHECK_DUP_KEY + HA_CHECK_DUP_UNIQUE) |
Definition at line 243 of file handler.h.
Referenced by Item_sum_count_distinct::add(), copy_data_between_tables(), create_myisam_from_heap(), end_write(), replace_user_table(), and write_record().
| #define HA_CHECK_DUP_KEY 1 |
Definition at line 241 of file handler.h.
Referenced by handler::is_fatal_error(), replace_db_table(), replace_routine_table(), replace_table_table(), and write_record().
| #define ha_commit | ( | thd | ) | (ha_commit_trans((thd), TRUE)) |
Definition at line 1601 of file handler.h.
Referenced by copy_data_between_tables(), end_active_trans(), end_trans(), mysql_discard_or_import_tablespace(), mysql_execute_command(), and set_option_autocommit().
| #define ha_commit_stmt | ( | thd | ) | (ha_commit_trans((thd), FALSE)) |
Definition at line 1599 of file handler.h.
Referenced by close_thread_tables(), copy_data_between_tables(), ha_autocommit_or_rollback(), ha_enable_transaction(), and mysql_discard_or_import_tablespace().
| #define HA_CREATE_USED_AUTO (1L << 0) |
Definition at line 287 of file handler.h.
Referenced by ha_heap::check_if_incompatible_data(), mysql_alter_table(), ha_archive::update_create_info(), ha_myisam::update_create_info(), and ha_heap::update_create_info().
| #define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6) |
| #define HA_CREATE_USED_CHARSET (1L << 8) |
Definition at line 295 of file handler.h.
Referenced by compare_tables(), and mysql_execute_command().
| #define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9) |
Definition at line 296 of file handler.h.
Referenced by compare_tables(), mysql_alter_table(), mysql_execute_command(), and store_create_info().
| #define HA_CREATE_USED_ENGINE (1L << 12) |
Definition at line 299 of file handler.h.
Referenced by check_engine(), compare_tables(), mysql_alter_table(), mysql_create_table_internal(), and store_create_info().
| #define HA_CREATE_USED_INSERT_METHOD (1L << 3) |
| #define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19) |
| #define HA_CREATE_USED_MAX_ROWS (1L << 5) |
| #define HA_CREATE_USED_MIN_ROWS (1L << 4) |
| #define HA_CREATE_USED_PACK_KEYS (1L << 7) |
| #define HA_CREATE_USED_UNION (1L << 2) |
Definition at line 289 of file handler.h.
Referenced by mysql_execute_command(), and ha_myisammrg::update_create_info().
| #define HA_DUPLICATE_POS (1 << 8) |
| #define HA_FAST_KEY_READ (1 << 5) |
Definition at line 70 of file handler.h.
Referenced by filesort(), init_read_record(), and ha_heap::table_flags().
| #define HA_FILE_BASED (1 << 26) |
Definition at line 112 of file handler.h.
Referenced by ha_create_table(), ha_create_table_from_engine(), ha_delete_table(), mysql_rename_table(), ha_blackhole::table_flags(), ha_archive::table_flags(), ha_myisammrg::table_flags(), and ha_federated::table_flags().
| #define HA_GET_INDEX 4 |
Definition at line 211 of file handler.h.
Referenced by open_temporary_table(), and open_unireg_entry().
| #define HA_GET_INFO 8 |
| #define HA_HAS_CHECKSUM (1 << 24) |
Definition at line 110 of file handler.h.
Referenced by handler::get_dynamic_partition_info(), get_schema_tables_record(), mysql_checksum_table(), ha_myisam::open(), and store_schema_partitions_record().
| #define HA_HAS_RECORDS (LL(1) << 32) |
Definition at line 118 of file handler.h.
Referenced by opt_sum_query(), and ha_heap::table_flags().
| #define HA_KEY_BLOB_LENGTH 2 |
Definition at line 223 of file handler.h.
Referenced by calc_group_buffer(), do_varstring2(), Field_blob::get_key_image(), Field_varstring::get_key_image(), get_mm_leaf(), Field_blob::key_cmp(), Field_varstring::key_cmp(), key_copy(), key_restore(), Field_varstring::pack_cmp(), Field_blob::pack_key_from_key_image(), Field_varstring::pack_key_from_key_image(), Field_blob::set_key_image(), and Field_varstring::set_key_image().
| #define HA_KEY_SCAN_NOT_ROR 128 |
| #define HA_KEY_SWITCH_ALL 1 |
Definition at line 191 of file handler.h.
Referenced by create_myisam_from_heap(), ha_myisam::disable_indexes(), ha_heap::disable_indexes(), ha_myisam::enable_indexes(), and ha_heap::enable_indexes().
| #define HA_KEY_SWITCH_NONUNIQ_SAVE 2 |
Definition at line 192 of file handler.h.
Referenced by ha_myisam::disable_indexes(), ha_myisam::enable_indexes(), ha_myisam::end_bulk_insert(), and mysql_alter_table().
| #define HA_KEYREAD_ONLY 64 |
Definition at line 128 of file handler.h.
Referenced by get_key_scans_params(), ha_blackhole::index_flags(), ha_myisammrg::index_flags(), ha_myisam::index_flags(), and ha_innobase::index_flags().
| #define HA_LEX_CREATE_IF_NOT_EXISTS 2 |
Definition at line 226 of file handler.h.
Referenced by Events::create_event(), mysql_create_db(), mysql_create_like_table(), mysql_create_table_internal(), and mysqld_show_create_db().
| #define HA_LEX_CREATE_TMP_TABLE 1 |
Definition at line 225 of file handler.h.
Referenced by check_engine(), create_frm(), create_table_from_items(), create_table_precheck(), mysql_alter_table(), mysql_create_frm(), mysql_create_like_table(), mysql_create_table_internal(), mysql_execute_command(), and sp_get_flags_for_command().
| #define HA_MAX_REC_LENGTH 65535 |
Definition at line 229 of file handler.h.
Referenced by ha_tina::max_record_length(), handler::max_record_length(), ha_example::max_supported_record_length(), handler::max_supported_record_length(), and ha_federated::max_supported_record_length().
| #define HA_NEED_READ_RANGE_BUFFER (1 << 29) |
| #define HA_NO_AUTO_INCREMENT (1 << 23) |
| #define HA_NO_BLOBS (1 << 9) |
| #define HA_NO_COPY_ON_ALTER (LL(1) << 31) |
| #define HA_NO_PREFIX_CHAR_KEYS (1 << 20) |
| #define HA_NO_TRANSACTIONS (1 << 0) |
Definition at line 52 of file handler.h.
Referenced by handler::has_transactions(), ha_tina::table_flags(), ha_archive::table_flags(), ha_myisammrg::table_flags(), and ha_heap::table_flags().
| #define HA_NO_VARCHAR (1 << 27) |
| #define HA_NOT_DELETE_WITH_CACHE (1 << 18) |
| #define HA_NULL_IN_KEY (1 << 7) |
Definition at line 76 of file handler.h.
Referenced by ha_blackhole::table_flags(), ha_myisammrg::table_flags(), ha_heap::table_flags(), and ha_federated::table_flags().
| #define HA_ONLINE_DROP_INDEX (1L << 7) |
| #define HA_ONLINE_DROP_INDEX_NO_WRITES (1L << 1) |
| #define HA_ONLINE_DROP_PK_INDEX (1L << 11) |
| #define HA_ONLINE_DROP_PK_INDEX_NO_WRITES (1L << 5) |
| #define HA_ONLINE_DROP_UNIQUE_INDEX (1L << 9) |
| #define HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES (1L << 3) |
| #define HA_ONLY_WHOLE_INDEX 16 |
Definition at line 127 of file handler.h.
Referenced by best_access_path(), ha_archive::index_flags(), and ha_heap::index_flags().
| #define HA_OPEN_KEYFILE 1 |
Definition at line 209 of file handler.h.
Referenced by create_tmp_table(), open_table_from_share(), open_temporary_table(), and open_unireg_entry().
| #define HA_OPEN_RNDFILE 2 |
Definition at line 210 of file handler.h.
Referenced by create_tmp_table(), open_temporary_table(), and open_unireg_entry().
| #define HA_OPEN_TEMPORARY 512 |
| #define HA_OPTION_NO_CHECKSUM (1L << 17) |
| #define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18) |
| #define HA_PARTIAL_COLUMN_READ (1 << 1) |
| #define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) |
Definition at line 93 of file handler.h.
Referenced by check_if_key_used(), get_best_group_min_max(), st_table::prepare_for_position(), safe_update_on_fly(), and ha_federated::table_flags().
| #define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19) |
Definition at line 105 of file handler.h.
Referenced by st_table::mark_columns_needed_for_delete(), st_table::mark_columns_needed_for_update(), and ha_federated::table_flags().
| #define HA_READ_NEXT 1 |
Definition at line 123 of file handler.h.
Referenced by ha_blackhole::index_flags(), ha_myisammrg::index_flags(), ha_myisam::index_flags(), ha_innobase::index_flags(), ha_heap::index_flags(), and ha_federated::index_flags().
| #define HA_READ_ONLY 16 |
Definition at line 213 of file handler.h.
Referenced by ha_myisam::check(), handler::ha_open(), init_read_record(), lock_external(), mysql_admin_table(), and open_table_from_share().
| #define HA_READ_ORDER 4 |
Definition at line 125 of file handler.h.
Referenced by find_key_for_maxmin(), get_index_for_order(), get_schema_stat_record(), ha_blackhole::index_flags(), ha_myisammrg::index_flags(), ha_myisam::index_flags(), ha_innobase::index_flags(), ha_heap::index_flags(), and handler::read_first_row().
| #define HA_READ_PREV 2 |
Definition at line 124 of file handler.h.
Referenced by ha_blackhole::index_flags(), ha_myisammrg::index_flags(), ha_myisam::index_flags(), ha_innobase::index_flags(), ha_heap::index_flags(), and test_if_order_by_key().
| #define HA_READ_RANGE 8 |
Definition at line 126 of file handler.h.
Referenced by ha_blackhole::index_flags(), ha_myisammrg::index_flags(), ha_myisam::index_flags(), ha_innobase::index_flags(), ha_heap::index_flags(), ha_federated::index_flags(), and Field::optimize_range().
| #define HA_REC_NOT_IN_SEQ (1 << 3) |
Definition at line 63 of file handler.h.
Referenced by find_all_keys(), ha_myisam::open(), ha_tina::table_flags(), ha_archive::table_flags(), ha_myisammrg::table_flags(), ha_heap::table_flags(), and ha_federated::table_flags().
| #define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6) |
Definition at line 75 of file handler.h.
Referenced by st_table::mark_columns_needed_for_delete(), and st_table::mark_columns_needed_for_update().
| #define ha_reset_logs | ( | a | ) | do {} while (0) |
| #define ha_rollback | ( | thd | ) | (ha_rollback_trans((thd), TRUE)) |
| #define ha_rollback_stmt | ( | thd | ) | (ha_rollback_trans((thd), FALSE)) |
Definition at line 1600 of file handler.h.
Referenced by ha_autocommit_or_rollback(), and lock_tables().
| #define HA_STATS_RECORDS_IS_EXACT (1 << 13) |
Definition at line 82 of file handler.h.
Referenced by end_send(), make_join_statistics(), opt_sum_query(), and ha_heap::table_flags().
| #define HA_TABLE_SCAN_ON_INDEX (1 << 2) |
| #define HA_TRY_READ_ONLY 32 |
Definition at line 215 of file handler.h.
Referenced by handler::ha_open(), and open_unireg_entry().
| #define HA_WAIT_IF_LOCKED 64 |
| #define HTON_ALTER_NOT_SUPPORTED (1 << 1) |
| #define HTON_CAN_RECREATE (1 << 2) |
Definition at line 677 of file handler.h.
Referenced by blackhole_init(), example_init_func(), heap_init(), myisam_init(), myisammrg_init(), mysql_truncate(), and tina_init_func().
| #define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0) |
| #define HTON_HIDDEN (1 << 3) |
Definition at line 678 of file handler.h.
Referenced by binlog_init(), iter_schema_engines(), and show_handlerton().
| #define HTON_NO_FLAGS 0 |
| #define HTON_NOT_USER_SELECTABLE (1 << 5) |
| #define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) |
| #define MAX_XID_LIST_SIZE (1024*128) |
| #define MIN_XID_LIST_SIZE 128 |
| #define MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT 1 |
| #define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid)) |
| #define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id)) |
Definition at line 311 of file handler.h.
Referenced by xid_t::quick_get_my_xid(), and xid_t::set().
| #define MYSQL_XID_PREFIX "MySQLXid" |
| #define MYSQL_XID_PREFIX_LEN 8 |
| #define trans_need_2pc | ( | thd, | |||
| all | ) |
Value:
((total_ha_2pc > 1) && \ !((all ? &thd->transaction.all : &thd->transaction.stmt)->no_2pc))
| #define UNDEF_NODEGROUP 65535 |
Definition at line 713 of file handler.h.
Referenced by analyse_one_map(), default_nodegroups(), Dbdih::execCREATE_FRAGMENTATION_REQ(), init_nodegroup_map(), BackupRestore::map_ng(), set_default_node_groups(), set_default_nodegroups(), st_alter_tablespace::st_alter_tablespace(), and store_schema_partitions_record().
| #define XIDDATASIZE 128 |
Definition at line 314 of file handler.h.
Referenced by mysql_xa_recover(), trx_undo_read_xid(), trx_undo_write_xid(), xarecover_handlerton(), and xid_to_str().
| typedef struct st_foreign_key_info FOREIGN_KEY_INFO |
| typedef struct st_ha_check_opt HA_CHECK_OPT |
| typedef struct st_ha_create_information HA_CREATE_INFO |
| typedef struct st_handler_buffer HANDLER_BUFFER |
| typedef struct st_key_create_information KEY_CREATE_INFO |
| typedef struct system_status_var SSV |
| typedef struct st_table_share TABLE_SHARE |
| typedef struct st_thd_trans THD_TRANS |
| enum enum_binlog_command |
| LOGCOM_CREATE_TABLE | |
| LOGCOM_ALTER_TABLE | |
| LOGCOM_RENAME_TABLE | |
| LOGCOM_DROP_TABLE | |
| LOGCOM_CREATE_DB | |
| LOGCOM_ALTER_DB | |
| LOGCOM_DROP_DB |
Definition at line 274 of file handler.h.
00274 { 00275 LOGCOM_CREATE_TABLE, 00276 LOGCOM_ALTER_TABLE, 00277 LOGCOM_RENAME_TABLE, 00278 LOGCOM_DROP_TABLE, 00279 LOGCOM_CREATE_DB, 00280 LOGCOM_ALTER_DB, 00281 LOGCOM_DROP_DB 00282 };
| enum enum_binlog_func |
Definition at line 266 of file handler.h.
00266 { 00267 BFN_RESET_LOGS= 1, 00268 BFN_RESET_SLAVE= 2, 00269 BFN_BINLOG_WAIT= 3, 00270 BFN_BINLOG_END= 4, 00271 BFN_BINLOG_PURGE_FILE= 5 00272 };
| enum enum_tx_isolation |
Definition at line 693 of file handler.h.
00693 { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, 00694 ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
| enum ha_stat_type |
Definition at line 483 of file handler.h.
00483 { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
Definition at line 517 of file handler.h.
00518 { 00519 HA_ITERATOR_OK, /* iterator created */ 00520 HA_ITERATOR_UNSUPPORTED, /* such type of iterator is not supported */ 00521 HA_ITERATOR_ERROR /* error during iterator creation */ 00522 };
Definition at line 512 of file handler.h.
00513 { 00514 /* request of transaction log iterator */ 00515 HA_TRANSACTLOG_ITERATOR= 1 00516 };
| enum legacy_db_type |
Definition at line 245 of file handler.h.
00246 { 00247 DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1, 00248 DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM, 00249 DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM, 00250 DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM, 00251 DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, 00252 DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER, 00253 DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB, 00254 DB_TYPE_FEDERATED_DB, 00255 DB_TYPE_BLACKHOLE_DB, 00256 DB_TYPE_PARTITION_DB, 00257 DB_TYPE_BINLOG, 00258 DB_TYPE_FIRST_DYNAMIC=32, 00259 DB_TYPE_DEFAULT=127 // Must be last 00260 };
| enum log_status |
Definition at line 487 of file handler.h.
00488 { 00489 HA_LOG_STATUS_FREE= 0, /* log is free and can be deleted */ 00490 HA_LOG_STATUS_INUSE= 1, /* log can't be deleted because it is in use */ 00491 HA_LOG_STATUS_NOSUCHLOG= 2 /* no such log (can't be returned by 00492 the log iterator status) */ 00493 };
| enum ndb_distribution |
| enum row_type |
| ROW_TYPE_NOT_USED | |
| ROW_TYPE_DEFAULT | |
| ROW_TYPE_FIXED | |
| ROW_TYPE_DYNAMIC | |
| ROW_TYPE_COMPRESSED | |
| ROW_TYPE_REDUNDANT | |
| ROW_TYPE_COMPACT | |
| ROW_TYPE_PAGES |
Definition at line 262 of file handler.h.
00262 { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, 00263 ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED, 00264 ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGES };
Definition at line 421 of file handler.h.
00422 { 00423 TS_NOT_DEFINED= -1, 00424 TS_READ_ONLY = 0, 00425 TS_READ_WRITE = 1, 00426 TS_NOT_ACCESSIBLE = 2 00427 };
| TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED | |
| ALTER_TABLESPACE_ADD_FILE | |
| ALTER_TABLESPACE_DROP_FILE |
Definition at line 414 of file handler.h.
00415 { 00416 TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1, 00417 ALTER_TABLESPACE_ADD_FILE = 1, 00418 ALTER_TABLESPACE_DROP_FILE = 2 00419 };
| enum ts_command_type |
| TS_CMD_NOT_DEFINED | |
| CREATE_TABLESPACE | |
| ALTER_TABLESPACE | |
| CREATE_LOGFILE_GROUP | |
| ALTER_LOGFILE_GROUP | |
| DROP_TABLESPACE | |
| DROP_LOGFILE_GROUP | |
| CHANGE_FILE_TABLESPACE | |
| ALTER_ACCESS_MODE_TABLESPACE |
Definition at line 401 of file handler.h.
00402 { 00403 TS_CMD_NOT_DEFINED = -1, 00404 CREATE_TABLESPACE = 0, 00405 ALTER_TABLESPACE = 1, 00406 CREATE_LOGFILE_GROUP = 2, 00407 ALTER_LOGFILE_GROUP = 3, 00408 DROP_TABLESPACE = 4, 00409 DROP_LOGFILE_GROUP = 5, 00410 CHANGE_FILE_TABLESPACE = 6, 00411 ALTER_ACCESS_MODE_TABLESPACE = 7 00412 };
| handler* get_new_handler | ( | TABLE_SHARE * | share, | |
| MEM_ROOT * | alloc, | |||
| handlerton * | db_type | |||
| ) |
Definition at line 238 of file handler.cc.
References handlerton::create, current_thd, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, get_new_handler(), handler::init(), SHOW_OPTION_YES, and handlerton::state.
Referenced by create_myisam_from_heap(), create_tmp_table(), execute_ddl_log_action(), get_new_handler(), ha_delete_table(), QUICK_RANGE_SELECT::init_ror_merged_scan(), mysql_create_table_internal(), mysql_rename_table(), open_table_error(), open_table_from_share(), and rm_temporary_table().
00240 { 00241 handler *file; 00242 DBUG_ENTER("get_new_handler"); 00243 DBUG_PRINT("enter", ("alloc: 0x%lx", (long) alloc)); 00244 00245 if (db_type && db_type->state == SHOW_OPTION_YES && db_type->create) 00246 { 00247 if ((file= db_type->create(share, alloc))) 00248 file->init(); 00249 DBUG_RETURN(file); 00250 } 00251 /* 00252 Try the default table type 00253 Here the call to current_thd() is ok as we call this function a lot of 00254 times but we enter this branch very seldom. 00255 */ 00256 DBUG_RETURN(get_new_handler(share, alloc, 00257 current_thd->variables.table_type)); 00258 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_autocommit_or_rollback | ( | THD * | thd, | |
| int | error | |||
| ) |
Definition at line 821 of file handler.cc.
References DBUG_ENTER, DBUG_RETURN, ha_commit_stmt, and ha_rollback_stmt.
Referenced by mysql_admin_table(), mysql_delete(), mysql_discard_or_import_tablespace(), mysql_insert(), and mysql_load().
00822 { 00823 DBUG_ENTER("ha_autocommit_or_rollback"); 00824 #ifdef USING_TRANSACTIONS 00825 if (thd->transaction.stmt.nht) 00826 { 00827 if (!error) 00828 { 00829 if (ha_commit_stmt(thd)) 00830 error=1; 00831 } 00832 else 00833 (void) ha_rollback_stmt(thd); 00834 00835 thd->variables.tx_isolation=thd->session_tx_isolation; 00836 } 00837 #endif 00838 DBUG_RETURN(error); 00839 }
Here is the caller graph for this function:

Definition at line 2692 of file handler.cc.
References mi_change_key_cache().
Referenced by reassign_keycache_tables().
02694 { 02695 mi_change_key_cache(old_key_cache, new_key_cache); 02696 return 0; 02697 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_change_key_cache_param | ( | KEY_CACHE * | key_cache | ) |
Definition at line 2669 of file handler.cc.
References change_key_cache_param(), st_key_cache::key_cache_inited, LOCK_global_system_variables, st_key_cache::param_age_threshold, st_key_cache::param_division_limit, pthread_mutex_lock, and pthread_mutex_unlock.
02670 { 02671 if (key_cache->key_cache_inited) 02672 { 02673 pthread_mutex_lock(&LOCK_global_system_variables); 02674 uint division_limit= key_cache->param_division_limit; 02675 uint age_threshold= key_cache->param_age_threshold; 02676 pthread_mutex_unlock(&LOCK_global_system_variables); 02677 change_key_cache_param(key_cache, division_limit, age_threshold); 02678 } 02679 return 0; 02680 }
Here is the call graph for this function:

| static bool ha_check_storage_engine_flag | ( | const handlerton * | db_type, | |
| uint32 | flag | |||
| ) | [inline, static] |
Definition at line 1625 of file handler.h.
References FALSE, handlerton::flags, NULL, and test.
Referenced by check_engine(), mysql_alter_table(), and mysql_truncate().
Here is the caller graph for this function:

| handlerton* ha_checktype | ( | THD * | thd, | |
| enum legacy_db_type | database_type, | |||
| bool | no_substitute, | |||
| bool | report_error | |||
| ) |
Definition at line 206 of file handler.cc.
References DB_TYPE_HASH, DB_TYPE_MRG_ISAM, DB_TYPE_MRG_MYISAM, ER_FEATURE_DISABLED, ha_default_handlerton(), ha_get_storage_engine(), ha_resolve_by_legacy_type(), ha_storage_engine_is_enabled(), my_error(), MYF, and NULL.
Referenced by sys_var_thd_storage_engine::check(), check_engine(), create_frm(), mysql_create_table_internal(), and open_binary_frm().
00208 { 00209 handlerton *hton= ha_resolve_by_legacy_type(thd, database_type); 00210 if (ha_storage_engine_is_enabled(hton)) 00211 return hton; 00212 00213 if (no_substitute) 00214 { 00215 if (report_error) 00216 { 00217 const char *engine_name= ha_get_storage_engine(database_type); 00218 my_error(ER_FEATURE_DISABLED,MYF(0),engine_name,engine_name); 00219 } 00220 return NULL; 00221 } 00222 00223 switch (database_type) { 00224 #ifndef NO_HASH 00225 case DB_TYPE_HASH: 00226 return ha_resolve_by_legacy_type(thd, DB_TYPE_HASH); 00227 #endif 00228 case DB_TYPE_MRG_ISAM: 00229 return ha_resolve_by_legacy_type(thd, DB_TYPE_MRG_MYISAM); 00230 default: 00231 break; 00232 } 00233 00234 return ha_default_handlerton(thd); 00235 } /* ha_checktype */
Here is the call graph for this function:

Here is the caller graph for this function:

| void ha_close_connection | ( | THD * | thd | ) |
Definition at line 529 of file handler.cc.
References closecon_handlerton(), MYSQL_STORAGE_ENGINE_PLUGIN, and plugin_foreach().
00530 { 00531 plugin_foreach(thd, closecon_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, 0); 00532 }
Here is the call graph for this function:

| int ha_commit_one_phase | ( | THD * | thd, | |
| bool | all | |||
| ) |
Definition at line 707 of file handler.cc.
References DBUG_ENTER, DBUG_RETURN, ER_ERROR_DURING_COMMIT, err, error, st_thd_trans::ht, ht, Query_cache::invalidate(), LOCK_status, my_error(), MYF, st_thd_trans::nht, st_thd_trans::no_2pc, query_cache, and statistic_increment.
Referenced by ha_commit_trans(), and mysql_execute_command().
00708 { 00709 int error=0; 00710 THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; 00711 bool is_real_trans=all || thd->transaction.all.nht == 0; 00712 handlerton **ht=trans->ht; 00713 DBUG_ENTER("ha_commit_one_phase"); 00714 #ifdef USING_TRANSACTIONS 00715 if (trans->nht) 00716 { 00717 for (ht=trans->ht; *ht; ht++) 00718 { 00719 int err; 00720 if ((err= (*(*ht)->commit)(thd, all))) 00721 { 00722 my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); 00723 error=1; 00724 } 00725 statistic_increment(thd->status_var.ha_commit_count,&LOCK_status); 00726 *ht= 0; 00727 } 00728 trans->nht=0; 00729 trans->no_2pc=0; 00730 if (is_real_trans) 00731 thd->transaction.xid_state.xid.null(); 00732 if (all) 00733 { 00734 #ifdef HAVE_QUERY_CACHE 00735 if (thd->transaction.changed_tables) 00736 query_cache.invalidate(thd->transaction.changed_tables); 00737 #endif 00738 thd->variables.tx_isolation=thd->session_tx_isolation; 00739 thd->transaction.cleanup(); 00740 } 00741 } 00742 #endif /* USING_TRANSACTIONS */ 00743 DBUG_RETURN(error); 00744 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 872 of file handler.cc.
References MYSQL_STORAGE_ENGINE_PLUGIN, NULL, plugin_foreach(), xahton_st::result, xacommit_handlerton(), xarollback_handlerton(), and xahton_st::xid.
Referenced by mysql_execute_command().
00873 { 00874 struct xahton_st xaop; 00875 xaop.xid= xid; 00876 xaop.result= 1; 00877 00878 plugin_foreach(NULL, commit ? xacommit_handlerton : xarollback_handlerton, 00879 MYSQL_STORAGE_ENGINE_PLUGIN, &xaop); 00880 00881 return xaop.result; 00882 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_commit_trans | ( | THD * | thd, | |
| bool | all | |||
| ) |
Definition at line 625 of file handler.cc.
References abort(), DBUG_ASSERT, DBUG_ENTER, DBUG_EXECUTE_IF, DBUG_RETURN, ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, ER_ERROR_DURING_COMMIT, err, error, ha_commit_one_phase(), ha_rollback_trans(), st_thd_trans::ht, ht, LOCK_status, TC_LOG::log(), my_error(), MYF, st_thd_trans::nht, st_thd_trans::no_2pc, start_waiting_global_read_lock(), statistic_increment, tc_log, TC_LOG::unlog(), and wait_if_global_read_lock().
00626 { 00627 int error= 0, cookie= 0; 00628 THD_TRANS *trans= all ? &thd->transaction.all : &thd->transaction.stmt; 00629 bool is_real_trans= all || thd->transaction.all.nht == 0; 00630 handlerton **ht= trans->ht; 00631 my_xid xid= thd->transaction.xid_state.xid.get_my_xid(); 00632 DBUG_ENTER("ha_commit_trans"); 00633 00634 if (thd->in_sub_stmt) 00635 { 00636 /* 00637 Since we don't support nested statement transactions in 5.0, 00638 we can't commit or rollback stmt transactions while we are inside 00639 stored functions or triggers. So we simply do nothing now. 00640 TODO: This should be fixed in later ( >= 5.1) releases. 00641 */ 00642 if (!all) 00643 DBUG_RETURN(0); 00644 /* 00645 We assume that all statements which commit or rollback main transaction 00646 are prohibited inside of stored functions or triggers. So they should 00647 bail out with error even before ha_commit_trans() call. To be 100% safe 00648 let us throw error in non-debug builds. 00649 */ 00650 DBUG_ASSERT(0); 00651 my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); 00652 DBUG_RETURN(2); 00653 } 00654 #ifdef USING_TRANSACTIONS 00655 if (trans->nht) 00656 { 00657 if (is_real_trans && wait_if_global_read_lock(thd, 0, 0)) 00658 { 00659 ha_rollback_trans(thd, all); 00660 DBUG_RETURN(1); 00661 } 00662 DBUG_EXECUTE_IF("crash_commit_before", abort();); 00663 00664 /* Close all cursors that can not survive COMMIT */ 00665 if (is_real_trans) /* not a statement commit */ 00666 thd->stmt_map.close_transient_cursors(); 00667 00668 if (!trans->no_2pc && trans->nht > 1) 00669 { 00670 for (; *ht && !error; ht++) 00671 { 00672 int err; 00673 if ((err= (*(*ht)->prepare)(thd, all))) 00674 { 00675 my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); 00676 error= 1; 00677 } 00678 statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status); 00679 } 00680 DBUG_EXECUTE_IF("crash_commit_after_prepare", abort();); 00681 if (error || (is_real_trans && xid && 00682 (error= !(cookie= tc_log->log(thd, xid))))) 00683 { 00684 ha_rollback_trans(thd, all); 00685 error= 1; 00686 goto end; 00687 } 00688 DBUG_EXECUTE_IF("crash_commit_after_log", abort();); 00689 } 00690 error=ha_commit_one_phase(thd, all) ? cookie ? 2 : 1 : 0; 00691 DBUG_EXECUTE_IF("crash_commit_before_unlog", abort();); 00692 if (cookie) 00693 tc_log->unlog(cookie, xid); 00694 DBUG_EXECUTE_IF("crash_commit_after", abort();); 00695 end: 00696 if (is_real_trans) 00697 start_waiting_global_read_lock(thd); 00698 } 00699 #endif /* USING_TRANSACTIONS */ 00700 DBUG_RETURN(error); 00701 }
Here is the call graph for this function:

| int ha_create_table | ( | THD * | thd, | |
| const char * | path, | |||
| const char * | db, | |||
| const char * | table_name, | |||
| HA_CREATE_INFO * | create_info, | |||
| bool | update_create_info | |||
| ) |
Definition at line 2491 of file handler.cc.
References closefrm(), handler::create(), DBUG_ENTER, DBUG_RETURN, ER_CANT_CREATE_TABLE, err, error, st_table::file, files_charset_info, FN_REFLEN, free_table_share(), HA_FILE_BASED, handler::ha_table_flags(), init_tmp_table_share(), lower_case_table_names, ME_BELL, ME_WAITTANG, my_casedn_str, my_error(), MYF, name, NullS, open_table_def(), open_table_from_share(), st_table_share::path, READ_ALL, LEX_STRING::str, strmov(), strxmov(), TRUE, update_create_info_from_table(), and VOID.
Referenced by mysql_create_like_table(), mysql_truncate(), and rea_create_table().
02495 { 02496 int error= 1; 02497 TABLE table; 02498 char name_buff[FN_REFLEN]; 02499 const char *name; 02500 TABLE_SHARE share; 02501 DBUG_ENTER("ha_create_table"); 02502 02503 init_tmp_table_share(&share, db, 0, table_name, path); 02504 if (open_table_def(thd, &share, 0) || 02505 open_table_from_share(thd, &share, "", 0, (uint) READ_ALL, 0, &table, 02506 TRUE)) 02507 goto err; 02508 02509 if (update_create_info) 02510 update_create_info_from_table(create_info, &table); 02511 02512 name= share.path.str; 02513 if (lower_case_table_names == 2 && 02514 !(table.file->ha_table_flags() & HA_FILE_BASED)) 02515 { 02516 /* Ensure that handler gets name in lower case */ 02517 strmov(name_buff, name); 02518 my_casedn_str(files_charset_info, name_buff); 02519 name= name_buff; 02520 } 02521 02522 error= table.file->create(name, &table, create_info); 02523 VOID(closefrm(&table, 0)); 02524 if (error) 02525 { 02526 strxmov(name_buff, db, ".", table_name, NullS); 02527 my_error(ER_CANT_CREATE_TABLE, MYF(ME_BELL+ME_WAITTANG), name_buff, error); 02528 } 02529 err: 02530 free_table_share(&share); 02531 DBUG_RETURN(error != 0); 02532 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_create_table_from_engine | ( | THD * | thd, | |
| const char * | db, | |||
| const char * | name | |||
| ) |
Definition at line 2547 of file handler.cc.
References bzero, closefrm(), handler::create(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, FALSE, st_table::file, files_charset_info, FN_REFLEN, free_table_share(), ha_discover(), HA_FILE_BASED, HA_OPTION_CREATE_FROM_ENGINE, handler::ha_table_flags(), init_tmp_table_share(), lower_case_table_names, my_casedn_str, my_free, MYF, mysql_data_home, NullS, open_table_def(), open_table_from_share(), path, strxnmov(), update_create_info_from_table(), VOID, and writefrm().
Referenced by get_table_share_with_create(), mysql_rm_table_part2(), and open_unireg_entry().
02548 { 02549 int error; 02550 const void *frmblob; 02551 uint frmlen; 02552 char path[FN_REFLEN]; 02553 HA_CREATE_INFO create_info; 02554 TABLE table; 02555 TABLE_SHARE share; 02556 DBUG_ENTER("ha_create_table_from_engine"); 02557 DBUG_PRINT("enter", ("name '%s'.'%s'", db, name)); 02558 02559 bzero((char*) &create_info,sizeof(create_info)); 02560 if ((error= ha_discover(thd, db, name, &frmblob, &frmlen))) 02561 { 02562 /* Table could not be discovered and thus not created */ 02563 DBUG_RETURN(error); 02564 } 02565 02566 /* 02567 Table exists in handler and could be discovered 02568 frmblob and frmlen are set, write the frm to disk 02569 */ 02570 02571 (void)strxnmov(path,FN_REFLEN-1,mysql_data_home,"/",db,"/",name,NullS); 02572 // Save the frm file 02573 error= writefrm(path, frmblob, frmlen); 02574 my_free((char*) frmblob, MYF(0)); 02575 if (error) 02576 DBUG_RETURN(2); 02577 02578 init_tmp_table_share(&share, db, 0, name, path); 02579 if (open_table_def(thd, &share, 0)) 02580 { 02581 DBUG_RETURN(3); 02582 } 02583 if (open_table_from_share(thd, &share, "" ,0, 0, 0, &table, FALSE)) 02584 { 02585 free_table_share(&share); 02586 DBUG_RETURN(3); 02587 } 02588 02589 update_create_info_from_table(&create_info, &table); 02590 create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE; 02591 02592 if (lower_case_table_names == 2 && 02593 !(table.file->ha_table_flags() & HA_FILE_BASED)) 02594 { 02595 /* Ensure that handler gets name in lower case */ 02596 my_casedn_str(files_charset_info, path); 02597 } 02598 error=table.file->create(path,&table,&create_info); 02599 VOID(closefrm(&table, 1)); 02600 02601 DBUG_RETURN(error != 0); 02602 }
Here is the call graph for this function:

Here is the caller graph for this function:

| handlerton* ha_default_handlerton | ( | THD * | thd | ) |
Definition at line 107 of file handler.cc.
References global_system_variables, myisam_hton, NULL, and system_variables::table_type.
Referenced by create_default(), ha_checktype(), ha_resolve_by_legacy_type(), ha_resolve_by_name(), and mysql_alter_tablespace().
00108 { 00109 return (thd->variables.table_type != NULL) ? 00110 thd->variables.table_type : 00111 (global_system_variables.table_type != NULL ? 00112 global_system_variables.table_type : &myisam_hton); 00113 }
Here is the caller graph for this function:

| int ha_delete_table | ( | THD * | thd, | |
| handlerton * | db_type, | |||
| const char * | path, | |||
| const char * | db, | |||
| const char * | alias, | |||
| bool | generate_warning | |||
| ) |
Definition at line 1343 of file handler.cc.
References bzero, DBUG_ENTER, DBUG_RETURN, handler::delete_table(), error, files_charset_info, FN_REFLEN, get_new_handler(), HA_FILE_BASED, handler::ha_table_flags(), lower_case_table_names, my_casedn_str, NULL, handler::print_error(), push_warning(), strlen(), strmake(), strmov(), and MYSQL_ERROR::WARN_LEVEL_ERROR.
Referenced by mysql_rm_table_part2(), and quick_rm_table().
01345 { 01346 handler *file; 01347 char tmp_path[FN_REFLEN]; 01348 int error; 01349 TABLE dummy_table; 01350 TABLE_SHARE dummy_share; 01351 DBUG_ENTER("ha_delete_table"); 01352 01353 bzero((char*) &dummy_table, sizeof(dummy_table)); 01354 bzero((char*) &dummy_share, sizeof(dummy_share)); 01355 dummy_table.s= &dummy_share; 01356 01357 /* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */ 01358 if (table_type == NULL || 01359 ! (file=get_new_handler(&dummy_share, thd->mem_root, table_type))) 01360 DBUG_RETURN(ENOENT); 01361 01362 if (lower_case_table_names == 2 && !(file->ha_table_flags() & HA_FILE_BASED)) 01363 { 01364 /* Ensure that table handler get path in lower case */ 01365 strmov(tmp_path, path); 01366 my_casedn_str(files_charset_info, tmp_path); 01367 path= tmp_path; 01368 } 01369 if ((error= file->delete_table(path)) && generate_warning) 01370 { 01371 /* 01372 Because file->print_error() use my_error() to generate the error message 01373 we must store the error state in thd, reset it and restore it to 01374 be able to get hold of the error message. 01375 (We should in the future either rewrite handler::print_error() or make 01376 a nice method of this. 01377 */ 01378 bool query_error= thd->query_error; 01379 sp_rcontext *spcont= thd->spcont; 01380 SELECT_LEX *current_select= thd->lex->current_select; 01381 char buff[sizeof(thd->net.last_error)]; 01382 char new_error[sizeof(thd->net.last_error)]; 01383 int last_errno= thd->net.last_errno; 01384 01385 strmake(buff, thd->net.last_error, sizeof(buff)-1); 01386 thd->query_error= 0; 01387 thd->spcont= 0; 01388 thd->lex->current_select= 0; 01389 thd->net.last_error[0]= 0; 01390 01391 /* Fill up strucutures that print_error may need */ 01392 dummy_share.path.str= (char*) path; 01393 dummy_share.path.length= strlen(path); 01394 dummy_share.db.str= (char*) db; 01395 dummy_share.db.length= strlen(db); 01396 dummy_share.table_name.str= (char*) alias; 01397 dummy_share.table_name.length= strlen(alias); 01398 dummy_table.alias= alias; 01399 01400 file->print_error(error, 0); 01401 strmake(new_error, thd->net.last_error, sizeof(buff)-1); 01402 01403 /* restore thd */ 01404 thd->query_error= query_error; 01405 thd->spcont= spcont; 01406 thd->lex->current_select= current_select; 01407 thd->net.last_errno= last_errno; 01408 strmake(thd->net.last_error, buff, sizeof(buff)-1); 01409 push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, new_error); 01410 } 01411 delete file; 01412 DBUG_RETURN(error); 01413 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_discover | ( | THD * | thd, | |
| const char * | dbname, | |||
| const char * | name, | |||
| const void ** | frmblob, | |||
| uint * | frmlen | |||
| ) |
Definition at line 2709 of file handler.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, have_ndbcluster, is_prefix(), LOCK_status, ndbcluster_discover(), SHOW_OPTION_YES, statistic_increment, and tmp_file_prefix.
Referenced by ha_create_table_from_engine().
02711 { 02712 int error= -1; // Table does not exist in any handler 02713 DBUG_ENTER("ha_discover"); 02714 DBUG_PRINT("enter", ("db: %s, name: %s", db, name)); 02715 if (is_prefix(name,tmp_file_prefix)) /* skip temporary tables */ 02716 DBUG_RETURN(error); 02717 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE 02718 if (have_ndbcluster == SHOW_OPTION_YES) 02719 error= ndbcluster_discover(thd, db, name, frmblob, frmlen); 02720 #endif 02721 if (!error) 02722 statistic_increment(thd->status_var.ha_discover_count,&LOCK_status); 02723 DBUG_RETURN(error); 02724 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ha_drop_database | ( | char * | path | ) |
Definition at line 507 of file handler.cc.
References dropdb_handlerton(), MYSQL_STORAGE_ENGINE_PLUGIN, NULL, and plugin_foreach().
Referenced by mysql_rm_db().
00508 { 00509 plugin_foreach(NULL, dropdb_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, path); 00510 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_enable_transaction | ( | THD * | thd, | |
| bool | on | |||
| ) |
Definition at line 2419 of file handler.cc.
References COMMIT, DBUG_ENTER, DBUG_RETURN, end_trans(), error, and ha_commit_stmt.
Referenced by copy_data_between_tables(), mysql_load(), and mysql_truncate().
02420 { 02421 int error=0; 02422 02423 DBUG_ENTER("ha_enable_transaction"); 02424 thd->transaction.on= on; 02425 if (on) 02426 { 02427 /* 02428 Now all storage engines should have transaction handling enabled. 02429 But some may have it enabled all the time - "disabling" transactions 02430 is an optimization hint that storage engine is free to ignore. 02431 So, let's commit an open transaction (if any) now. 02432 */ 02433 if (!(error= ha_commit_stmt(thd))) 02434 error= end_trans(thd, COMMIT); 02435 } 02436 DBUG_RETURN(error); 02437 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_end_key_cache | ( | KEY_CACHE * | key_cache | ) |
Definition at line 2684 of file handler.cc.
References end_key_cache().
Referenced by free_key_cache().
02685 { 02686 end_key_cache(key_cache, 1); // Can never fail 02687 return 0; 02688 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_finalize_handlerton | ( | st_plugin_int * | plugin | ) |
Definition at line 376 of file handler.cc.
References st_plugin_int::data, handlerton::db_type, DBUG_ENTER, DBUG_RETURN, HA_PANIC_CLOSE, installed_htons, NULL, handlerton::panic, SHOW_OPTION_DISABLED, SHOW_OPTION_NO, SHOW_OPTION_YES, and handlerton::state.
Referenced by plugin_finalize().
00377 { 00378 handlerton *hton= (handlerton *)plugin->data; 00379 DBUG_ENTER("ha_finalize_handlerton"); 00380 00381 switch (hton->state) 00382 { 00383 case SHOW_OPTION_NO: 00384 case SHOW_OPTION_DISABLED: 00385 break; 00386 case SHOW_OPTION_YES: 00387 if (installed_htons[hton->db_type] == hton) 00388 installed_htons[hton->db_type]= NULL; 00389 if (hton->panic && hton->panic(HA_PANIC_CLOSE)) 00390 DBUG_RETURN(1); 00391 break; 00392 }; 00393 DBUG_RETURN(0); 00394 }
Here is the caller graph for this function:

| int ha_find_files | ( | THD * | thd, | |
| const char * | db, | |||
| const char * | path, | |||
| const char * | wild, | |||
| bool | dir, | |||
| List< char > * | files | |||
| ) |
Definition at line 2734 of file handler.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, files, have_ndbcluster, ndbcluster_find_files(), and SHOW_OPTION_YES.
Referenced by find_files().
02736 { 02737 int error= 0; 02738 DBUG_ENTER("ha_find_files"); 02739 DBUG_PRINT("enter", ("db: %s, path: %s, wild: %s, dir: %d", 02740 db, path, wild, dir)); 02741 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE 02742 if (have_ndbcluster == SHOW_OPTION_YES) 02743 error= ndbcluster_find_files(thd, db, path, wild, dir, files); 02744 #endif 02745 DBUG_RETURN(error); 02746 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool ha_flush_logs | ( | handlerton * | db_type | ) |
Definition at line 1321 of file handler.cc.
References FALSE, flush_handlerton(), handlerton::flush_logs, MYSQL_STORAGE_ENGINE_PLUGIN, NULL, plugin_foreach(), SHOW_OPTION_YES, handlerton::state, and TRUE.
Referenced by reload_acl_and_cache().
01322 { 01323 if (db_type == NULL) 01324 { 01325 if (plugin_foreach(NULL, flush_handlerton, 01326 MYSQL_STORAGE_ENGINE_PLUGIN, 0)) 01327 return TRUE; 01328 } 01329 else 01330 { 01331 if (db_type->state != SHOW_OPTION_YES || 01332 (db_type->flush_logs && db_type->flush_logs())) 01333 return TRUE; 01334 } 01335 return FALSE; 01336 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* ha_get_storage_engine | ( | enum legacy_db_type | db_type | ) |
Definition at line 166 of file handler.cc.
References DB_TYPE_DEFAULT, DB_TYPE_UNKNOWN, hton2plugin, installed_htons, st_plugin_int::name, handlerton::slot, and LEX_STRING::str.
Referenced by ha_checktype().
00167 { 00168 switch (db_type) { 00169 case DB_TYPE_DEFAULT: 00170 return "DEFAULT"; 00171 default: 00172 if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT && 00173 installed_htons[db_type]) 00174 return hton2plugin[installed_htons[db_type]->slot]->name.str; 00175 /* fall through */ 00176 case DB_TYPE_UNKNOWN: 00177 return "UNKNOWN"; 00178 } 00179 }
Here is the caller graph for this function:

| int ha_init | ( | void | ) |
Definition at line 452 of file handler.cc.
References DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, error, ha_init_errors(), MAX_HA, opt_bin_log, opt_using_transactions, savepoint_alloc_size, and total_ha.
Referenced by init_server_components().
00453 { 00454 int error= 0; 00455 DBUG_ENTER("ha_init"); 00456 00457 if (ha_init_errors()) 00458 DBUG_RETURN(1); 00459 00460 DBUG_ASSERT(total_ha < MAX_HA); 00461 /* 00462 Check if there is a transaction-capable storage engine besides the 00463 binary log (which is considered a transaction-capable storage engine in 00464 counting total_ha) 00465 */ 00466 opt_using_transactions= total_ha>(ulong)opt_bin_log; 00467 savepoint_alloc_size+= sizeof(SAVEPOINT); 00468 DBUG_RETURN(error); 00469 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_init_key_cache | ( | const char * | name, | |
| KEY_CACHE * | key_cache | |||
| ) |
Definition at line 2624 of file handler.cc.
References DBUG_ENTER, DBUG_RETURN, init_key_cache(), st_key_cache::key_cache_inited, LOCK_global_system_variables, st_key_cache::param_age_threshold, st_key_cache::param_block_size, st_key_cache::param_buff_size, st_key_cache::param_division_limit, pthread_mutex_lock, and pthread_mutex_unlock.
Referenced by init_server_components(), and sys_var_key_buffer_size::update().
02625 { 02626 DBUG_ENTER("ha_init_key_cache"); 02627 02628 if (!key_cache->key_cache_inited) 02629 { 02630 pthread_mutex_lock(&LOCK_global_system_variables); 02631 long tmp_buff_size= (long) key_cache->param_buff_size; 02632 long tmp_block_size= (long) key_cache->param_block_size; 02633 uint division_limit= key_cache->param_division_limit; 02634 uint age_threshold= key_cache->param_age_threshold; 02635 pthread_mutex_unlock(&LOCK_global_system_variables); 02636 DBUG_RETURN(!init_key_cache(key_cache, 02637 tmp_block_size, 02638 tmp_buff_size, 02639 division_limit, age_threshold)); 02640 } 02641 DBUG_RETURN(0); 02642 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_initialize_handlerton | ( | st_plugin_int * | plugin | ) |
Definition at line 397 of file handler.cc.
References st_plugin_int::data, handlerton::db_type, DB_TYPE_DEFAULT, DB_TYPE_FIRST_DYNAMIC, DB_TYPE_UNKNOWN, DBUG_ENTER, DBUG_RETURN, hton2plugin, st_mysql_plugin::info, installed_htons, int(), st_mysql_plugin::name, st_plugin_int::plugin, handlerton::prepare, savepoint_alloc_size, handlerton::savepoint_offset, SHOW_OPTION_DISABLED, SHOW_OPTION_NO, SHOW_OPTION_YES, handlerton::slot, sql_print_warning(), handlerton::state, total_ha, and total_ha_2pc.
00398 { 00399 handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; 00400 DBUG_ENTER("ha_initialize_handlerton"); 00401 00402 plugin->data= hton; // shortcut for the future 00403 00404 /* 00405 the switch below and hton->state should be removed when 00406 command-line options for plugins will be implemented 00407 */ 00408 switch (hton->state) { 00409 case SHOW_OPTION_NO: 00410 break; 00411 case SHOW_OPTION_YES: 00412 { 00413 uint tmp; 00414 /* now check the db_type for conflict */ 00415 if (hton->db_type <= DB_TYPE_UNKNOWN || 00416 hton->db_type >= DB_TYPE_DEFAULT || 00417 installed_htons[hton->db_type]) 00418 { 00419 int idx= (int) DB_TYPE_FIRST_DYNAMIC; 00420 00421 while (idx < (int) DB_TYPE_DEFAULT && installed_htons[idx]) 00422 idx++; 00423 00424 if (idx == (int) DB_TYPE_DEFAULT) 00425 { 00426 sql_print_warning("Too many storage engines!"); 00427 DBUG_RETURN(1); 00428 } 00429 if (hton->db_type != DB_TYPE_UNKNOWN) 00430 sql_print_warning("Storage engine '%s' has conflicting typecode. " 00431 "Assigning value %d.", plugin->plugin->name, idx); 00432 hton->db_type= (enum legacy_db_type) idx; 00433 } 00434 installed_htons[hton->db_type]= hton; 00435 tmp= hton->savepoint_offset; 00436 hton->savepoint_offset= savepoint_alloc_size; 00437 savepoint_alloc_size+= tmp; 00438 hton->slot= total_ha++; 00439 hton2plugin[hton->slot]=plugin; 00440 if (hton->prepare) 00441 total_ha_2pc++; 00442 break; 00443 } 00444 /* fall through */ 00445 default: 00446 hton->state= SHOW_OPTION_DISABLED; 00447 break; 00448 } 00449 DBUG_RETURN(0); 00450 }
Here is the call graph for this function:

| TYPELIB* ha_known_exts | ( | void | ) |
Definition at line 3210 of file handler.cc.
References st_typelib::count, current_thd, DBUG_ASSERT, base_list::elements, exts_handlerton(), known_extensions, known_extensions_id, MY_FAE, my_once_alloc(), MY_WME, MYF, MYSQL_STORAGE_ENGINE_PLUGIN, mysys_usage_id, NULL, plugin_foreach(), List< T >::push_back(), triggers_file_ext, trigname_file_ext, and st_typelib::type_names.
Referenced by mysql_rm_known_files().
03211 { 03212 MEM_ROOT *mem_root= current_thd->mem_root; 03213 if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) 03214 { 03215 List<char> found_exts; 03216 const char **ext, *old_ext; 03217 03218 known_extensions_id= mysys_usage_id; 03219 found_exts.push_back((char*) triggers_file_ext); 03220 found_exts.push_back((char*) trigname_file_ext); 03221 03222 plugin_foreach(NULL, exts_handlerton, 03223 MYSQL_STORAGE_ENGINE_PLUGIN, &found_exts); 03224 03225 ext= (const char **) my_once_alloc(sizeof(char *)* 03226 (found_exts.elements+1), 03227 MYF(MY_WME | MY_FAE)); 03228 03229 DBUG_ASSERT(ext != 0); 03230 known_extensions.count= found_exts.elements; 03231 known_extensions.type_names= ext; 03232 03233 List_iterator_fast<char> it(found_exts); 03234 while ((old_ext= it++)) 03235 *ext++= old_ext; 03236 *ext= 0; 03237 } 03238 return &known_extensions; 03239 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static enum legacy_db_type ha_legacy_type | ( | const handlerton * | db_type | ) | [inline, static] |
Definition at line 1615 of file handler.h.
References handlerton::db_type, DB_TYPE_UNKNOWN, and NULL.
Referenced by sys_var_thd_storage_engine::check(), check_engine(), create_frm(), mysql_create_frm(), mysql_create_table_internal(), and open_binary_frm().
01616 { 01617 return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type; 01618 }
Here is the caller graph for this function:

| int ha_panic | ( | enum ha_panic_function | flag | ) |
Definition at line 485 of file handler.cc.
References error, ha_finish_errors(), HA_PANIC_CLOSE, int(), MYSQL_STORAGE_ENGINE_PLUGIN, NULL, panic_handlerton(), and plugin_foreach().
Referenced by clean_up().
00486 { 00487 int error[2]; 00488 00489 error[0]= 0; error[1]= (int)flag; 00490 plugin_foreach(NULL, panic_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, error); 00491 00492 if (flag == HA_PANIC_CLOSE && ha_finish_errors()) 00493 error[0]= 1; 00494 return error[0]; 00495 } /* ha_panic */
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_prepare | ( | THD * | thd | ) |
Definition at line 584 of file handler.cc.
References DBUG_ENTER, DBUG_RETURN, ER, ER_ERROR_DURING_COMMIT, ER_ILLEGAL_HA, err, error, ha_rollback_trans(), st_thd_trans::ht, ht, hton2plugin, LOCK_status, my_error(), MYF, st_plugin_int::name, st_thd_trans::nht, push_warning_printf(), statistic_increment, LEX_STRING::str, and MYSQL_ERROR::WARN_LEVEL_WARN.
Referenced by mysql_execute_command().
00585 { 00586 int error=0, all=1; 00587 THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; 00588 handlerton **ht=trans->ht; 00589 DBUG_ENTER("ha_prepare"); 00590 #ifdef USING_TRANSACTIONS 00591 if (trans->nht) 00592 { 00593 for (; *ht; ht++) 00594 { 00595 int err; 00596 statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status); 00597 if ((*ht)->prepare) 00598 { 00599 if ((err= (*(*ht)->prepare)(thd, all))) 00600 { 00601 my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); 00602 ha_rollback_trans(thd, all); 00603 error=1; 00604 break; 00605 } 00606 } 00607 else 00608 { 00609 push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 00610 ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), 00611 hton2plugin[(*ht)->slot]->name.str); 00612 } 00613 } 00614 } 00615 #endif /* USING_TRANSACTIONS */ 00616 DBUG_RETURN(error); 00617 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_recover | ( | HASH * | commit_list | ) |
Definition at line 1025 of file handler.cc.
References xarecover_st::commit_list, DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, xarecover_st::dry_run, ER, ER_OUTOFMEMORY, FALSE, xarecover_st::found_foreign_xids, xarecover_st::found_my_xids, xarecover_st::len, xarecover_st::list, MAX_XID_LIST_SIZE, MIN_XID_LIST_SIZE, my_free, my_malloc(), MYF, MYSQL_STORAGE_ENGINE_PLUGIN, NULL, opt_bin_log, opt_tc_log_file, plugin_foreach(), sql_print_error(), sql_print_information(), sql_print_warning(), tc_heuristic_recover, TC_HEURISTIC_RECOVER_ROLLBACK, total_ha_2pc, and xarecover_handlerton().
Referenced by init_server_components(), and TC_LOG::using_heuristic_recover().
01026 { 01027 struct xarecover_st info; 01028 DBUG_ENTER("ha_recover"); 01029 info.found_foreign_xids= info.found_my_xids= 0; 01030 info.commit_list= commit_list; 01031 info.dry_run= (info.commit_list==0 && tc_heuristic_recover==0); 01032 info.list= NULL; 01033 01034 /* commit_list and tc_heuristic_recover cannot be set both */ 01035 DBUG_ASSERT(info.commit_list==0 || tc_heuristic_recover==0); 01036 /* if either is set, total_ha_2pc must be set too */ 01037 DBUG_ASSERT(info.dry_run || total_ha_2pc>(ulong)opt_bin_log); 01038 01039 if (total_ha_2pc <= (ulong)opt_bin_log) 01040 DBUG_RETURN(0); 01041 01042 if (info.commit_list) 01043 sql_print_information("Starting crash recovery..."); 01044 01045 #ifndef WILL_BE_DELETED_LATER 01046 /* 01047 for now, only InnoDB supports 2pc. It means we can always safely 01048 rollback all pending transactions, without risking inconsistent data 01049 */ 01050 DBUG_ASSERT(total_ha_2pc == (ulong) opt_bin_log+1); // only InnoDB and binlog 01051 tc_heuristic_recover= TC_HEURISTIC_RECOVER_ROLLBACK; // forcing ROLLBACK 01052 info.dry_run=FALSE; 01053 #endif 01054 01055 for (info.len= MAX_XID_LIST_SIZE ; 01056 info.list==0 && info.len > MIN_XID_LIST_SIZE; info.len/=2) 01057 { 01058 info.list=(XID *)my_malloc(info.len*sizeof(XID), MYF(0)); 01059 } 01060 if (!info.list) 01061 { 01062 sql_print_error(ER(ER_OUTOFMEMORY), info.len*sizeof(XID)); 01063 DBUG_RETURN(1); 01064 } 01065 01066 plugin_foreach(NULL, xarecover_handlerton, 01067 MYSQL_STORAGE_ENGINE_PLUGIN, &info); 01068 01069 my_free((gptr)info.list, MYF(0)); 01070 if (info.found_foreign_xids) 01071 sql_print_warning("Found %d prepared XA transactions", 01072 info.found_foreign_xids); 01073 if (info.dry_run && info.found_my_xids) 01074 { 01075 sql_print_error("Found %d prepared transactions! It means that mysqld was " 01076 "not shut down properly last time and critical recovery " 01077 "information (last binlog or %s file) was manually deleted " 01078 "after a crash. You have to start mysqld with " 01079 "--tc-heuristic-recover switch to commit or rollback " 01080 "pending transactions.", 01081 info.found_my_xids, opt_tc_log_file); 01082 DBUG_RETURN(1); 01083 } 01084 if (info.commit_list) 01085 sql_print_information("Crash recovery finished."); 01086 DBUG_RETURN(0); 01087 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_release_savepoint | ( | THD * | thd, | |
| SAVEPOINT * | sv | |||
| ) |
Definition at line 1256 of file handler.cc.
References DBUG_ENTER, ER_GET_ERRNO, err, error, st_thd_trans::ht, ht, my_error(), and MYF.
Referenced by mysql_execute_command().
01257 { 01258 int error=0; 01259 THD_TRANS *trans= (thd->in_sub_stmt ? &thd->transaction.stmt : 01260 &thd->transaction.all); 01261 handlerton **ht=trans->ht, **end_ht; 01262 DBUG_ENTER("ha_release_savepoint"); 01263 01264 end_ht=ht+sv->nht; 01265 for (; ht < end_ht; ht++) 01266 { 01267 int err; 01268 if (!(*ht)->savepoint_release) 01269 continue; 01270 if ((err= (*(*ht)->savepoint_release)(thd, (byte *)(sv+1)+(*ht)->savepoint_offset))) 01271 { // cannot happen 01272 my_error(ER_GET_ERRNO, MYF(0), err); 01273 error=1; 01274 } 01275 } 01276 DBUG_RETURN(error); 01277 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_release_temporary_latches | ( | THD * | thd | ) |
Definition at line 1167 of file handler.cc.
References MYSQL_STORAGE_ENGINE_PLUGIN, NULL, plugin_foreach(), and release_temporary_latches().
Referenced by Sensitive_cursor::fetch().
01168 { 01169 plugin_foreach(thd, release_temporary_latches, MYSQL_STORAGE_ENGINE_PLUGIN, 01170 NULL); 01171 01172 return 0; 01173 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_resize_key_cache | ( | KEY_CACHE * | key_cache | ) |
Definition at line 2647 of file handler.cc.
References DBUG_ENTER, DBUG_RETURN, st_key_cache::key_cache_inited, LOCK_global_system_variables, st_key_cache::param_age_threshold, st_key_cache::param_block_size, st_key_cache::param_buff_size, st_key_cache::param_division_limit, pthread_mutex_lock, pthread_mutex_unlock, and resize_key_cache().
Referenced by reassign_keycache_tables(), sys_var_key_buffer_size::update(), and sys_var_key_cache_long::update().
02648 { 02649 DBUG_ENTER("ha_resize_key_cache"); 02650 02651 if (key_cache->key_cache_inited) 02652 { 02653 pthread_mutex_lock(&LOCK_global_system_variables); 02654 long tmp_buff_size= (long) key_cache->param_buff_size; 02655 long tmp_block_size= (long) key_cache->param_block_size; 02656 uint division_limit= key_cache->param_division_limit; 02657 uint age_threshold= key_cache->param_age_threshold; 02658 pthread_mutex_unlock(&LOCK_global_system_variables); 02659 DBUG_RETURN(!resize_key_cache(key_cache, tmp_block_size, 02660 tmp_buff_size, 02661 division_limit, age_threshold)); 02662 } 02663 DBUG_RETURN(0); 02664 }
Here is the call graph for this function:

Here is the caller graph for this function:

| handlerton* ha_resolve_by_legacy_type | ( | THD * | thd, | |
| enum legacy_db_type | db_type | |||
| ) |
Definition at line 189 of file handler.cc.
References DB_TYPE_DEFAULT, DB_TYPE_UNKNOWN, ha_default_handlerton(), installed_htons, and NULL.
Referenced by ha_checktype(), mysql_rm_table_part2(), mysql_truncate(), and rename_tables().
00190 { 00191 switch (db_type) { 00192 case DB_TYPE_DEFAULT: 00193 return ha_default_handlerton(thd); 00194 case DB_TYPE_UNKNOWN: 00195 return NULL; 00196 default: 00197 if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT) 00198 return installed_htons[db_type]; 00199 return NULL; 00200 } 00201 }
Here is the call graph for this function:

Here is the caller graph for this function:

| handlerton* ha_resolve_by_name | ( | THD * | thd, | |
| const LEX_STRING * | name | |||
| ) |
Definition at line 128 of file handler.cc.
References charset_info_st::coll, st_plugin_int::data, handlerton::flags, ha_default_handlerton(), HTON_NOT_USER_SELECTABLE, LEX_STRING::length, my_charset_latin1, my_strnncoll, MYSQL_STORAGE_ENGINE_PLUGIN, name, plugin_lock(), plugin_unlock(), LEX_STRING::str, STRING_WITH_LEN, my_collation_handler_st::strnncoll, and sys_table_aliases.
Referenced by sys_var_thd_storage_engine::check(), execute_ddl_log_action(), init_server_components(), and open_binary_frm().
00129 { 00130 const LEX_STRING *table_alias; 00131 st_plugin_int *plugin; 00132 00133 redo: 00134 /* my_strnncoll is a macro and gcc doesn't do early expansion of macro */ 00135 if (thd && !my_charset_latin1.coll->strnncoll(&my_charset_latin1, 00136 (const uchar *)name->str, name->length, 00137 (const uchar *)STRING_WITH_LEN("DEFAULT"), 0)) 00138 return ha_default_handlerton(thd); 00139 00140 if ((plugin= plugin_lock(name, MYSQL_STORAGE_ENGINE_PLUGIN))) 00141 { 00142 handlerton *hton= (handlerton *)plugin->data; 00143 if (!(hton->flags & HTON_NOT_USER_SELECTABLE)) 00144 return hton; 00145 plugin_unlock(plugin); 00146 } 00147 00148 /* 00149 We check for the historical aliases. 00150 */ 00151 for (table_alias= sys_table_aliases; table_alias->str; table_alias+= 2) 00152 { 00153 if (!my_strnncoll(&my_charset_latin1, 00154 (const uchar *)name->str, name->length, 00155 (const uchar *)table_alias->str, table_alias->length)) 00156 { 00157 name= table_alias + 1; 00158 goto redo; 00159 } 00160 } 00161 00162 return NULL; 00163 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static const char* ha_resolve_storage_engine_name | ( | const handlerton * | db_type | ) | [inline, static] |
Definition at line 1620 of file handler.h.
References hton2plugin, st_plugin_int::name, NULL, handlerton::slot, and LEX_STRING::str.
Referenced by check_engine(), mysql_alter_table(), mysql_create_frm(), and store_create_info().
01621 { 01622 return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str; 01623 }
Here is the caller graph for this function:

| int ha_rollback_to_savepoint | ( | THD * | thd, | |
| SAVEPOINT * | sv | |||
| ) |
Definition at line 1175 of file handler.cc.
References DBUG_ASSERT, DBUG_ENTER, ER_ERROR_DURING_ROLLBACK, err, error, st_thd_trans::ht, ht, LOCK_status, my_error(), MYF, st_thd_trans::nht, st_thd_trans::no_2pc, and statistic_increment.
Referenced by mysql_execute_command().
01176 { 01177 int error=0; 01178 THD_TRANS *trans= (thd->in_sub_stmt ? &thd->transaction.stmt : 01179 &thd->transaction.all); 01180 handlerton **ht=trans->ht, **end_ht; 01181 DBUG_ENTER("ha_rollback_to_savepoint"); 01182 01183 trans->nht=sv->nht; 01184 trans->no_2pc=0; 01185 end_ht=ht+sv->nht; 01186 /* 01187 rolling back to savepoint in all storage engines that were part of the 01188 transaction when the savepoint was set 01189 */ 01190 for (; ht < end_ht; ht++) 01191 { 01192 int err; 01193 DBUG_ASSERT((*ht)->savepoint_set != 0); 01194 if ((err= (*(*ht)->savepoint_rollback)(thd, (byte *)(sv+1)+(*ht)->savepoint_offset))) 01195 { // cannot happen 01196 my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err); 01197 error=1; 01198 } 01199 statistic_increment(thd->status_var.ha_savepoint_rollback_count, 01200 &LOCK_status); 01201 trans->no_2pc|=(*ht)->prepare == 0; 01202 } 01203 /* 01204 rolling back the transaction in all storage engines that were not part of 01205 the transaction when the savepoint was set 01206 */ 01207 for (; *ht ; ht++) 01208 { 01209 int err; 01210 if ((err= (*(*ht)->rollback)(thd, !thd->in_sub_stmt))) 01211 { // cannot happen 01212 my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err); 01213 error=1; 01214 } 01215 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status); 01216 *ht=0; // keep it conveniently zero-filled 01217 } 01218 DBUG_RETURN(error); 01219 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_rollback_trans | ( | THD * | thd, | |
| bool | all | |||
| ) |
Definition at line 747 of file handler.cc.
References DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, ER, ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, ER_ERROR_DURING_ROLLBACK, ER_WARNING_NOT_COMPLETE_ROLLBACK, err, error, st_thd_trans::ht, ht, LOCK_status, my_error(), MYF, st_thd_trans::nht, st_thd_trans::no_2pc, OPTION_STATUS_NO_TRANS_UPDATE, push_warning(), statistic_increment, and MYSQL_ERROR::WARN_LEVEL_WARN.
Referenced by ha_commit_trans(), and ha_prepare().
00748 { 00749 int error=0; 00750 THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; 00751 bool is_real_trans=all || thd->transaction.all.nht == 0; 00752 DBUG_ENTER("ha_rollback_trans"); 00753 if (thd->in_sub_stmt) 00754 { 00755 /* 00756 If we are inside stored function or trigger we should not commit or 00757 rollback current statement transaction. See comment in ha_commit_trans() 00758 call for more information. 00759 */ 00760 if (!all) 00761 DBUG_RETURN(0); 00762 DBUG_ASSERT(0); 00763 my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); 00764 DBUG_RETURN(1); 00765 } 00766 #ifdef USING_TRANSACTIONS 00767 if (trans->nht) 00768 { 00769 /* Close all cursors that can not survive ROLLBACK */ 00770 if (is_real_trans) /* not a statement commit */ 00771 thd->stmt_map.close_transient_cursors(); 00772 00773 for (handlerton **ht=trans->ht; *ht; ht++) 00774 { 00775 int err; 00776 if ((err= (*(*ht)->rollback)(thd, all))) 00777 { // cannot happen 00778 my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err); 00779 error=1; 00780 } 00781 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status); 00782 *ht= 0; 00783 } 00784 trans->nht=0; 00785 trans->no_2pc=0; 00786 if (is_real_trans) 00787 thd->transaction.xid_state.xid.null(); 00788 if (all) 00789 { 00790 thd->variables.tx_isolation=thd->session_tx_isolation; 00791 thd->transaction.cleanup(); 00792 } 00793 } 00794 #endif /* USING_TRANSACTIONS */ 00795 /* 00796 If a non-transactional table was updated, warn; don't warn if this is a 00797 slave thread (because when a slave thread executes a ROLLBACK, it has 00798 been read from the binary log, so it's 100% sure and normal to produce 00799 error ER_WARNING_NOT_COMPLETE_ROLLBACK. If we sent the warning to the 00800 slave SQL thread, it would not stop the thread but just be printed in 00801 the error log; but we don't want users to wonder why they have this 00802 message in the error log, so we don't send it. 00803 */ 00804 if (is_real_trans && (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && 00805 !thd->slave_thread) 00806 push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 00807 ER_WARNING_NOT_COMPLETE_ROLLBACK, 00808 ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)); 00809 DBUG_RETURN(error); 00810 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_savepoint | ( | THD * | thd, | |
| SAVEPOINT * | sv | |||
| ) |
Definition at line 1227 of file handler.cc.
References DBUG_ENTER, ER_CHECK_NOT_IMPLEMENTED, ER_GET_ERRNO, err, error, st_thd_trans::ht, ht, my_error(), and MYF.
Referenced by mysql_execute_command().
01228 { 01229 int error=0; 01230 THD_TRANS *trans= (thd->in_sub_stmt ? &thd->transaction.stmt : 01231 &thd->transaction.all); 01232 handlerton **ht=trans->ht; 01233 DBUG_ENTER("ha_savepoint"); 01234 #ifdef USING_TRANSACTIONS 01235 for (; *ht; ht++) 01236 { 01237 int err; 01238 if (! (*ht)->savepoint_set) 01239 { 01240 my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "SAVEPOINT"); 01241 error=1; 01242 break; 01243 } 01244 if ((err= (*(*ht)->savepoint_set)(thd, (byte *)(sv+1)+(*ht)->savepoint_offset))) 01245 { // cannot happen 01246 my_error(ER_GET_ERRNO, MYF(0), err); 01247 error=1; 01248 } 01249 statistic_increment(thd->status_var.ha_savepoint_count,&LOCK_status); 01250 } 01251 sv->nht=trans->nht; 01252 #endif /* USING_TRANSACTIONS */ 01253 DBUG_RETURN(error); 01254 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool ha_show_status | ( | THD * | thd, | |
| handlerton * | db_type, | |||
| enum ha_stat_type | stat | |||
| ) |
Definition at line 3268 of file handler.cc.
References FN_REFLEN, hton2plugin, MYSQL_STORAGE_ENGINE_PLUGIN, st_plugin_int::name, name, NULL, plugin_foreach(), List< T >::push_back(), send_eof(), Protocol::SEND_EOF, Protocol::send_fields(), Protocol::SEND_NUM_ROWS, SHOW_OPTION_YES, handlerton::show_status, showstat_handlerton(), handlerton::slot, stat_print(), handlerton::state, and TRUE.
Referenced by mysql_execute_command().
03269 { 03270 List<Item> field_list; 03271 Protocol *protocol= thd->protocol; 03272 bool result; 03273 03274 field_list.push_back(new Item_empty_string("Type",10)); 03275 field_list.push_back(new Item_empty_string("Name",FN_REFLEN)); 03276 field_list.push_back(new Item_empty_string("Status",10)); 03277 03278 if (protocol->send_fields(&field_list, 03279 Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) 03280 return TRUE; 03281 03282 if (db_type == NULL) 03283 { 03284 result= plugin_foreach(thd, showstat_handlerton, 03285 MYSQL_STORAGE_ENGINE_PLUGIN, &stat); 03286 } 03287 else 03288 { 03289 if (db_type->state != SHOW_OPTION_YES) 03290 { 03291 const LEX_STRING *name=&hton2plugin[db_type->slot]->name; 03292 result= stat_print(thd, name->str, name->length, 03293 "", 0, "DISABLED", 8) ? 1 : 0; 03294 } 03295 else 03296 result= db_type->show_status && 03297 db_type->show_status(thd, stat_print, stat) ? 1 : 0; 03298 } 03299 03300 if (!result) 03301 send_eof(thd); 03302 return result; 03303 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int ha_start_consistent_snapshot | ( | THD * | thd | ) |
Definition at line 1293 of file handler.cc.
References ER_UNKNOWN_ERROR, MYSQL_STORAGE_ENGINE_PLUGIN, plugin_foreach(), push_warning(), snapshot_handlerton(), and MYSQL_ERROR::WARN_LEVEL_WARN.
Referenced by begin_trans().
01294 { 01295 bool warn= true; 01296 01297 plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn); 01298 01299 /* 01300 Same idea as when one wants to CREATE TABLE in one engine which does not 01301 exist: 01302 */ 01303 if (warn) 01304 push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, 01305 "This MySQL server does not support any " 01306 "consistent-read capable storage engine"); 01307 return 0; 01308 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static bool ha_storage_engine_is_enabled | ( | const handlerton * | db_type | ) | [inline, static] |
Definition at line 1630 of file handler.h.
References handlerton::create, FALSE, SHOW_OPTION_YES, and handlerton::state.
Referenced by ha_checktype(), and init_server_components().
01631 { 01632 return (db_type && db_type->create) ? 01633 (db_type->state == SHOW_OPTION_YES) : FALSE; 01634 }
Here is the caller graph for this function:

| int ha_table_exists_in_engine | ( | THD * | thd, | |
| const char * | db, | |||
| const char * | name | |||
| ) |
Definition at line 2758 of file handler.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, have_ndbcluster, ndbcluster_table_exists_in_engine(), and SHOW_OPTION_YES.
Referenced by mysql_create_table_internal().
02759 { 02760 int error= 0; 02761 DBUG_ENTER("ha_table_exists_in_engine"); 02762 DBUG_PRINT("enter", ("db: %s, name: %s", db, name)); 02763 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE 02764 if (have_ndbcluster == SHOW_OPTION_YES) 02765 error= ndbcluster_table_exists_in_engine(thd, db, name); 02766 #endif 02767 DBUG_PRINT("exit", ("error: %d", error)); 02768 DBUG_RETURN(error); 02769 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void signal_log_not_needed | ( | struct | handlerton, | |
| char * | log_file | |||
| ) |
Definition at line 3593 of file handler.cc.
References DBUG_ENTER, DBUG_PRINT, and DBUG_VOID_RETURN.
03594 { 03595 DBUG_ENTER("signal_log_not_needed"); 03596 DBUG_PRINT("enter", ("logfile '%s'", log_file)); 03597 DBUG_VOID_RETURN; 03598 }
| void trans_register_ha | ( | THD * | thd, | |
| bool | all, | |||
| handlerton * | ht | |||
| ) |
Definition at line 552 of file handler.cc.
References DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, st_thd_trans::ht, ht, st_thd_trans::nht, st_thd_trans::no_2pc, handlerton::prepare, and SERVER_STATUS_IN_TRANS.
Referenced by MYSQL_BIN_LOG::write().
00553 { 00554 THD_TRANS *trans; 00555 handlerton **ht; 00556 DBUG_ENTER("trans_register_ha"); 00557 DBUG_PRINT("enter",("%s", all ? "all" : "stmt")); 00558 00559 if (all) 00560 { 00561 trans= &thd->transaction.all; 00562 thd->server_status|= SERVER_STATUS_IN_TRANS; 00563 } 00564 else 00565 trans= &thd->transaction.stmt; 00566 00567 for (ht=trans->ht; *ht; ht++) 00568 if (*ht == ht_arg) 00569 DBUG_VOID_RETURN; /* already registered, return */ 00570 00571 trans->ht[trans->nht++]=ht_arg; 00572 DBUG_ASSERT(*ht == ht_arg); 00573 trans->no_2pc|=(ht_arg->prepare==0); 00574 if (thd->transaction.xid_state.xid.is_null()) 00575 thd->transaction.xid_state.xid.set(thd->query_id); 00576 DBUG_VOID_RETURN; 00577 }
Here is the caller graph for this function:

| const char* ha_row_type[] |
Definition at line 82 of file handler.cc.
Referenced by get_schema_tables_record(), and store_create_info().
| st_plugin_int* hton2plugin[MAX_HA] |
Definition at line 52 of file handler.cc.
Referenced by check_engine(), ha_get_storage_engine(), ha_initialize_handlerton(), ha_prepare(), ha_resolve_storage_engine_name(), ha_show_status(), mysql_alter_tablespace(), sys_var_thd_storage_engine::value_ptr(), and xarecover_handlerton().
Definition at line 46 of file ha_myisam.cc.
Definition at line 71 of file handler.cc.
Referenced by ha_init(), ha_initialize_handlerton(), and mysql_execute_command().
Definition at line 69 of file handler.cc.
Referenced by ha_initialize_handlerton(), ha_recover(), and init_server_components().
1.4.7

