diff options
author | Igor Babaev <igor@askmonty.org> | 2012-07-10 16:34:39 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-07-10 16:34:39 -0700 |
commit | 47fae7f08fd0437cd555bbd6b2533a4117340c8d (patch) | |
tree | eaa1b4c3e8c40420196ff94272d1fa2cd520039d /sql/sql_base.cc | |
parent | 4a6a08309cd78091246a7fd598bc43cd25deba45 (diff) | |
download | mariadb-git-47fae7f08fd0437cd555bbd6b2533a4117340c8d.tar.gz |
Added procedures to delete records by keys from statistical tables.
Now when a table is dropped the statistics on the table is removed
from the statistical tables. If the table is altered in such a way
that a column is dropped or the type of the column is changed then
statistics on the column is removed from the table column_stat.
It also triggers removal of the statistics on the indexes who use
this column as its component.
Added procedures that changes the names of the tables or columns
in the statistical tables for.
These procedures are used when tables/columns are renamed.
Also partly re-factored the code that introduced the persistent
statistical tables.
Added test cases into statistics.test to cover the new code.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 0031da0c6b2..79f1c32ab1d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -9649,7 +9649,8 @@ unlock_tables_n_open_system_tables_for_write(THD *thd, DBUG_ENTER("unlock_tables_n_open_system_tables_for_write"); - mysql_unlock_tables(thd, thd->lock); + if (thd->lock) + mysql_unlock_tables(thd, thd->lock); thd->lock= 0; lex->reset_n_backup_query_tables_list(&query_tables_list_backup); |