diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-02-14 10:24:27 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-02-14 10:24:27 +0200 |
commit | 6158bea1ee30201a6230c21de7cbcb7f3a3c8fed (patch) | |
tree | 3c4a3aabddd03f0b49b650f268a1c2f1716f3760 /innobase/dict | |
parent | af96cbe1cf2b98f6761874119dc8fb3aff23bccb (diff) | |
download | mariadb-git-6158bea1ee30201a6230c21de7cbcb7f3a3c8fed.tar.gz |
dict0dict.h, dict0dict.c, row0mysql.c, ha_innobase.cc:
Add some more safety if MySQL tries to drop a table on which there are open handles
sql/ha_innobase.cc:
Add some more safety if MySQL tries to drop a table on which there are open handles
innobase/row/row0mysql.c:
Add some more safety if MySQL tries to drop a table on which there are open handles
innobase/dict/dict0dict.c:
Add some more safety if MySQL tries to drop a table on which there are open handles
innobase/include/dict0dict.h:
Add some more safety if MySQL tries to drop a table on which there are open handles
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 95f9b54c914..56bdf83aa4d 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 |