Loading innobase/dict/dict0dict.c +32 −0 Original line number Diff line number Diff line Loading @@ -195,6 +195,38 @@ dict_mutex_exit_for_mysql(void) mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Increments the count of open MySQL handles to a table. */ void dict_table_increment_handle_count( /*==============================*/ dict_table_t* table) /* in: table */ { mutex_enter(&(dict_sys->mutex)); table->n_mysql_handles_opened++; mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Decrements the count of open MySQL handles to a table. */ void dict_table_decrement_handle_count( /*==============================*/ dict_table_t* table) /* in: table */ { mutex_enter(&(dict_sys->mutex)); ut_a(table->n_mysql_handles_opened > 0); table->n_mysql_handles_opened--; mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Gets the nth column of a table. */ Loading innobase/dict/dict0mem.c +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ dict_mem_table_create( table->n_def = 0; table->n_cols = n_cols + DATA_N_SYS_COLS; table->mem_fix = 0; table->n_mysql_handles_opened = 0; table->cached = FALSE; table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS) Loading innobase/include/dict0dict.h +14 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,20 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" /************************************************************************ Increments the count of open MySQL handles to a table. */ void dict_table_increment_handle_count( /*==============================*/ dict_table_t* table); /* in: table */ /************************************************************************ Decrements the count of open MySQL handles to a table. */ void dict_table_decrement_handle_count( /*==============================*/ dict_table_t* table); /* in: table */ /************************************************************************** Inits the data dictionary module. */ Loading innobase/include/dict0mem.h +6 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,12 @@ struct dict_table_struct{ ulint mem_fix;/* count of how many times the table and its indexes has been fixed in memory; currently NOT used */ ulint n_mysql_handles_opened; /* count of how many handles MySQL has opened to this table; dropping of the table is NOT allowed until this count gets to zero; MySQL does NOT itself check the number of open handles at drop */ ibool cached; /* TRUE if the table object has been added to the dictionary cache */ lock_t* auto_inc_lock;/* a buffer for an auto-inc lock Loading innobase/include/mem0dbg.h +13 −1 Original line number Diff line number Diff line Loading @@ -10,11 +10,14 @@ Created 6/9/1994 Heikki Tuuri /* In the debug version each allocated field is surrounded with check fields whose sizes are given below */ #ifdef UNIV_MEM_DEBUG #define MEM_FIELD_HEADER_SIZE ut_calc_align(2 * sizeof(ulint),\ UNIV_MEM_ALIGNMENT) #define MEM_FIELD_TRAILER_SIZE sizeof(ulint) #else #define MEM_FIELD_HEADER_SIZE 0 #endif #define MEM_BLOCK_MAGIC_N 764741 /* Space needed when allocating for a user a field of length N. The space is allocated only in multiples of Loading Loading @@ -115,3 +118,12 @@ ibool mem_validate(void); /*===============*/ /* out: TRUE if ok */ /**************************************************************** Tries to find neigboring memory allocation blocks and dumps to stderr the neighborhood of a given pointer. */ void mem_analyze_corruption( /*===================*/ byte* ptr); /* in: pointer to place of possible corruption */ Loading
innobase/dict/dict0dict.c +32 −0 Original line number Diff line number Diff line Loading @@ -195,6 +195,38 @@ dict_mutex_exit_for_mysql(void) mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Increments the count of open MySQL handles to a table. */ void dict_table_increment_handle_count( /*==============================*/ dict_table_t* table) /* in: table */ { mutex_enter(&(dict_sys->mutex)); table->n_mysql_handles_opened++; mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Decrements the count of open MySQL handles to a table. */ void dict_table_decrement_handle_count( /*==============================*/ dict_table_t* table) /* in: table */ { mutex_enter(&(dict_sys->mutex)); ut_a(table->n_mysql_handles_opened > 0); table->n_mysql_handles_opened--; mutex_exit(&(dict_sys->mutex)); } /************************************************************************ Gets the nth column of a table. */ Loading
innobase/dict/dict0mem.c +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ dict_mem_table_create( table->n_def = 0; table->n_cols = n_cols + DATA_N_SYS_COLS; table->mem_fix = 0; table->n_mysql_handles_opened = 0; table->cached = FALSE; table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS) Loading
innobase/include/dict0dict.h +14 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,20 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" /************************************************************************ Increments the count of open MySQL handles to a table. */ void dict_table_increment_handle_count( /*==============================*/ dict_table_t* table); /* in: table */ /************************************************************************ Decrements the count of open MySQL handles to a table. */ void dict_table_decrement_handle_count( /*==============================*/ dict_table_t* table); /* in: table */ /************************************************************************** Inits the data dictionary module. */ Loading
innobase/include/dict0mem.h +6 −0 Original line number Diff line number Diff line Loading @@ -307,6 +307,12 @@ struct dict_table_struct{ ulint mem_fix;/* count of how many times the table and its indexes has been fixed in memory; currently NOT used */ ulint n_mysql_handles_opened; /* count of how many handles MySQL has opened to this table; dropping of the table is NOT allowed until this count gets to zero; MySQL does NOT itself check the number of open handles at drop */ ibool cached; /* TRUE if the table object has been added to the dictionary cache */ lock_t* auto_inc_lock;/* a buffer for an auto-inc lock Loading
innobase/include/mem0dbg.h +13 −1 Original line number Diff line number Diff line Loading @@ -10,11 +10,14 @@ Created 6/9/1994 Heikki Tuuri /* In the debug version each allocated field is surrounded with check fields whose sizes are given below */ #ifdef UNIV_MEM_DEBUG #define MEM_FIELD_HEADER_SIZE ut_calc_align(2 * sizeof(ulint),\ UNIV_MEM_ALIGNMENT) #define MEM_FIELD_TRAILER_SIZE sizeof(ulint) #else #define MEM_FIELD_HEADER_SIZE 0 #endif #define MEM_BLOCK_MAGIC_N 764741 /* Space needed when allocating for a user a field of length N. The space is allocated only in multiples of Loading Loading @@ -115,3 +118,12 @@ ibool mem_validate(void); /*===============*/ /* out: TRUE if ok */ /**************************************************************** Tries to find neigboring memory allocation blocks and dumps to stderr the neighborhood of a given pointer. */ void mem_analyze_corruption( /*===================*/ byte* ptr); /* in: pointer to place of possible corruption */