diff options
Diffstat (limited to 'innobase/dict')
-rw-r--r-- | innobase/dict/dict0dict.c | 32 | ||||
-rw-r--r-- | innobase/dict/dict0mem.c | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index b5a826dde02..8311c508ccc 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -196,6 +196,38 @@ dict_mutex_exit_for_mysql(void) } /************************************************************************ +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. */ dict_col_t* diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index 019d6ef334f..1f9a44aca35 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -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) |