MDEV-19513: Allocate dict_sys statically

dict_sys_t::create(): Renamed from dict_init().

dict_sys_t::close(): Renamed from dict_close().

dict_sys_t::add(): Sliced from dict_table_t::add_to_cache().

dict_sys_t::remove(): Renamed from dict_table_remove_from_cache().

dict_sys_t::prevent_eviction(): Renamed from
dict_table_move_from_lru_to_non_lru().

dict_sys_t::acquire(): Replaces dict_move_to_mru() and some more logic.

dict_sys_t::resize(): Renamed from dict_resize().

dict_sys_t::find(): Replaces dict_lru_find_table() and
dict_non_lru_find_table().
This commit is contained in:
Marko Mäkelä 2019-05-17 14:32:53 +03:00
commit 5fd7502e77
42 changed files with 660 additions and 882 deletions

View file

@ -111,9 +111,9 @@ dict_hdr_flush_row_id(void)
row_id_t id;
mtr_t mtr;
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&dict_sys.mutex));
id = dict_sys->row_id;
id = dict_sys.row_id;
mtr_start(&mtr);
@ -266,11 +266,11 @@ dict_boot(void)
mtr_start(&mtr);
/* Create the hash tables etc. */
dict_init();
dict_sys.create();
heap = mem_heap_create(450);
mutex_enter(&dict_sys->mutex);
mutex_enter(&dict_sys.mutex);
/* Get the dictionary header */
dict_hdr = dict_hdr_get(&mtr);
@ -285,7 +285,7 @@ dict_boot(void)
..._MARGIN, it will immediately be updated to the disk-based
header. */
dict_sys->row_id = DICT_HDR_ROW_ID_WRITE_MARGIN
dict_sys.row_id = DICT_HDR_ROW_ID_WRITE_MARGIN
+ ut_uint64_align_up(mach_read_from_8(dict_hdr + DICT_HDR_ROW_ID),
DICT_HDR_ROW_ID_WRITE_MARGIN);
@ -314,7 +314,7 @@ dict_boot(void)
dict_table_add_system_columns(table, heap);
table->add_to_cache();
dict_sys->sys_tables = table;
dict_sys.sys_tables = table;
mem_heap_empty(heap);
index = dict_mem_index_create(table, "CLUST_IND",
@ -355,7 +355,7 @@ dict_boot(void)
dict_table_add_system_columns(table, heap);
table->add_to_cache();
dict_sys->sys_columns = table;
dict_sys.sys_columns = table;
mem_heap_empty(heap);
index = dict_mem_index_create(table, "CLUST_IND",
@ -398,7 +398,7 @@ dict_boot(void)
dict_table_get_nth_col(table, DICT_COL__SYS_INDEXES__MERGE_THRESHOLD)
->def_val.len = UNIV_SQL_NULL;
table->add_to_cache();
dict_sys->sys_indexes = table;
dict_sys.sys_indexes = table;
mem_heap_empty(heap);
index = dict_mem_index_create(table, "CLUST_IND",
@ -427,7 +427,7 @@ dict_boot(void)
dict_table_add_system_columns(table, heap);
table->add_to_cache();
dict_sys->sys_fields = table;
dict_sys.sys_fields = table;
mem_heap_free(heap);
index = dict_mem_index_create(table, "CLUST_IND",
@ -475,14 +475,14 @@ dict_boot(void)
if (err == DB_SUCCESS) {
/* Load definitions of other indexes on system tables */
dict_load_sys_table(dict_sys->sys_tables);
dict_load_sys_table(dict_sys->sys_columns);
dict_load_sys_table(dict_sys->sys_indexes);
dict_load_sys_table(dict_sys->sys_fields);
dict_load_sys_table(dict_sys.sys_tables);
dict_load_sys_table(dict_sys.sys_columns);
dict_load_sys_table(dict_sys.sys_indexes);
dict_load_sys_table(dict_sys.sys_fields);
}
}
mutex_exit(&dict_sys->mutex);
mutex_exit(&dict_sys.mutex);
return(err);
}