diff options
author | unknown <monty@hundin.mysql.fi> | 2002-02-14 18:58:24 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-02-14 18:58:24 +0200 |
commit | 5fa6df3081eea58dbd21e24315e27d166e66d23c (patch) | |
tree | 9f6476af645cdeb53eefe6ca4f6bc6f4ac04bf84 /innobase/dict | |
parent | 7bff1b0c345c6d8f334bd31f693fb9cbe69ea120 (diff) | |
parent | 3a231663f034394fe341ebc98fa335f824fa3135 (diff) | |
download | mariadb-git-5fa6df3081eea58dbd21e24315e27d166e66d23c.tar.gz |
merge with 3.23.49
BitKeeper/etc/logging_ok:
auto-union
acconfig.h:
Auto merged
Docs/manual.texi:
Auto merged
client/client_priv.h:
Auto merged
include/mysql.h:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
mysql-test/t/comments.test:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/unireg.cc:
Auto merged
sql/unireg.h:
Auto merged
Diffstat (limited to 'innobase/dict')
-rw-r--r-- | innobase/dict/dict0dict.c | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 8311c508ccc..efdac031423 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -196,21 +196,6 @@ 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 @@ -496,6 +481,41 @@ dict_table_get( } /************************************************************************** +Returns a table object and increments MySQL open handle count on the table. +*/ + +dict_table_t* +dict_table_get_and_increment_handle_count( +/*======================================*/ + /* out: table, NULL if does not exist */ + char* table_name, /* in: table name */ + trx_t* trx) /* in: transaction handle or NULL */ +{ + dict_table_t* table; + + UT_NOT_USED(trx); + + mutex_enter(&(dict_sys->mutex)); + + table = dict_table_get_low(table_name); + + if (table != NULL) { + + table->n_mysql_handles_opened++; + } + + mutex_exit(&(dict_sys->mutex)); + + if (table != NULL) { + if (!table->stat_initialized) { + dict_update_statistics(table); + } + } + + return(table); +} + +/************************************************************************** Adds a table object to the dictionary cache. */ void |