diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/sql/table.cc b/sql/table.cc index 96a10e52dd3..22b4b2f9b5e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -423,7 +423,7 @@ void free_table_share(TABLE_SHARE *share) pthread_mutex_destroy(&share->mutex); pthread_cond_destroy(&share->cond); } - hash_free(&share->name_hash); + my_hash_free(&share->name_hash); plugin_unlock(NULL, share->db_plugin); share->db_plugin= NULL; @@ -1148,10 +1148,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, use_hash= share->fields >= MAX_FIELDS_BEFORE_HASH; if (use_hash) - use_hash= !hash_init(&share->name_hash, - system_charset_info, - share->fields,0,0, - (hash_get_key) get_field_name,0,0); + use_hash= !my_hash_init(&share->name_hash, + system_charset_info, + share->fields,0,0, + (my_hash_get_key) get_field_name,0,0); for (i=0 ; i < share->fields; i++, strpos+=field_pack_length, field_ptr++) { @@ -1591,7 +1591,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, delete handler_file; #ifndef DBUG_OFF if (use_hash) - (void) hash_check(&share->name_hash); + (void) my_hash_check(&share->name_hash); #endif DBUG_RETURN (0); @@ -1602,7 +1602,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, x_free((uchar*) disk_buff); delete crypted; delete handler_file; - hash_free(&share->name_hash); + my_hash_free(&share->name_hash); + if (share->ha_data_destroy) + share->ha_data_destroy(share->ha_data); open_table_error(share, error, share->open_errno, errarg); DBUG_RETURN(error); @@ -2933,7 +2935,7 @@ table_check_intact(TABLE *table, const uint table_f_count, Create Item_field for each column in the table. SYNPOSIS - st_table::fill_item_list() + TABLE::fill_item_list() item_list a pointer to an empty list used to store items DESCRIPTION @@ -2946,7 +2948,7 @@ table_check_intact(TABLE *table, const uint table_f_count, 1 out of memory */ -bool st_table::fill_item_list(List<Item> *item_list) const +bool TABLE::fill_item_list(List<Item> *item_list) const { /* All Item_field's created using a direct pointer to a field @@ -2966,7 +2968,7 @@ bool st_table::fill_item_list(List<Item> *item_list) const Fields of this table. SYNPOSIS - st_table::fill_item_list() + TABLE::fill_item_list() item_list a non-empty list with Item_fields DESCRIPTION @@ -2976,7 +2978,7 @@ bool st_table::fill_item_list(List<Item> *item_list) const is the same as the number of columns in the table. */ -void st_table::reset_item_list(List<Item> *item_list) const +void TABLE::reset_item_list(List<Item> *item_list) const { List_iterator_fast<Item> it(*item_list); for (Field **ptr= field; *ptr; ptr++) @@ -3918,14 +3920,14 @@ const char *Natural_join_column::db_name() return table_ref->view_db.str; /* - Test that TABLE_LIST::db is the same as st_table_share::db to + Test that TABLE_LIST::db is the same as TABLE_SHARE::db to ensure consistency. An exception are I_S schema tables, which are inconsistent in this respect. */ DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - table_ref->table->s->db.str[0] == 0)); + is_schema_db(table_ref->table->s->db.str))); return table_ref->db; } @@ -4137,13 +4139,13 @@ const char *Field_iterator_table_ref::get_db_name() return natural_join_it.column_ref()->db_name(); /* - Test that TABLE_LIST::db is the same as st_table_share::db to + Test that TABLE_LIST::db is the same as TABLE_SHARE::db to ensure consistency. An exception are I_S schema tables, which are inconsistent in this respect. */ DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - table_ref->table->s->db.str[0] == 0)); + is_schema_db(table_ref->table->s->db.str))); return table_ref->db; } @@ -4313,7 +4315,7 @@ Field_iterator_table_ref::get_natural_column_ref() /* Reset all columns bitmaps */ -void st_table::clear_column_bitmaps() +void TABLE::clear_column_bitmaps() { /* Reset column read/write usage. It's identical to: @@ -4334,9 +4336,9 @@ void st_table::clear_column_bitmaps() key fields. */ -void st_table::prepare_for_position() +void TABLE::prepare_for_position() { - DBUG_ENTER("st_table::prepare_for_position"); + DBUG_ENTER("TABLE::prepare_for_position"); if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) && s->primary_key < MAX_KEY) @@ -4355,14 +4357,14 @@ void st_table::prepare_for_position() NOTE: This changes the bitmap to use the tmp bitmap After this, you can't access any other columns in the table until - bitmaps are reset, for example with st_table::clear_column_bitmaps() - or st_table::restore_column_maps_after_mark_index() + bitmaps are reset, for example with TABLE::clear_column_bitmaps() + or TABLE::restore_column_maps_after_mark_index() */ -void st_table::mark_columns_used_by_index(uint index) +void TABLE::mark_columns_used_by_index(uint index) { MY_BITMAP *bitmap= &tmp_set; - DBUG_ENTER("st_table::mark_columns_used_by_index"); + DBUG_ENTER("TABLE::mark_columns_used_by_index"); (void) file->extra(HA_EXTRA_KEYREAD); bitmap_clear_all(bitmap); @@ -4383,9 +4385,9 @@ void st_table::mark_columns_used_by_index(uint index) when calling mark_columns_used_by_index */ -void st_table::restore_column_maps_after_mark_index() +void TABLE::restore_column_maps_after_mark_index() { - DBUG_ENTER("st_table::restore_column_maps_after_mark_index"); + DBUG_ENTER("TABLE::restore_column_maps_after_mark_index"); key_read= 0; (void) file->extra(HA_EXTRA_NO_KEYREAD); @@ -4399,7 +4401,7 @@ void st_table::restore_column_maps_after_mark_index() mark columns used by key, but don't reset other fields */ -void st_table::mark_columns_used_by_index_no_reset(uint index, +void TABLE::mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *bitmap) { KEY_PART_INFO *key_part= key_info[index].key_part; @@ -4418,7 +4420,7 @@ void st_table::mark_columns_used_by_index_no_reset(uint index, always set and sometimes read. */ -void st_table::mark_auto_increment_column() +void TABLE::mark_auto_increment_column() { DBUG_ASSERT(found_next_number_field); /* @@ -4451,7 +4453,7 @@ void st_table::mark_auto_increment_column() retrieve the row again. */ -void st_table::mark_columns_needed_for_delete() +void TABLE::mark_columns_needed_for_delete() { if (triggers) triggers->mark_fields_used(TRG_EVENT_DELETE); @@ -4501,7 +4503,7 @@ void st_table::mark_columns_needed_for_delete() retrieve the row again. */ -void st_table::mark_columns_needed_for_update() +void TABLE::mark_columns_needed_for_update() { DBUG_ENTER("mark_columns_needed_for_update"); if (triggers) @@ -4544,7 +4546,7 @@ void st_table::mark_columns_needed_for_update() as changed. */ -void st_table::mark_columns_needed_for_insert() +void TABLE::mark_columns_needed_for_insert() { if (triggers) { @@ -4574,7 +4576,7 @@ void st_table::mark_columns_needed_for_insert() TABLEs. Each of these TABLEs is called a part of a MERGE table. */ -bool st_table::is_children_attached(void) +bool TABLE::is_children_attached(void) { return((child_l && children_attached) || (parent && parent->children_attached)); @@ -4638,9 +4640,9 @@ Item_subselect *TABLE_LIST::containing_subselect() DESCRIPTION The parser collects the index hints for each table in a "tagged list" (TABLE_LIST::index_hints). Using the information in this tagged list - this function sets the members st_table::keys_in_use_for_query, + this function sets the members st_table::keys_in_use_for_query, st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by, - st_table::force_index, st_table::force_index_order, + st_table::force_index, st_table::force_index_order, st_table::force_index_group and st_table::covering_keys. Current implementation of the runtime does not allow mixing FORCE INDEX |