summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-07-10 16:34:39 -0700
committerIgor Babaev <igor@askmonty.org>2012-07-10 16:34:39 -0700
commit47fae7f08fd0437cd555bbd6b2533a4117340c8d (patch)
treeeaa1b4c3e8c40420196ff94272d1fa2cd520039d /sql/sql_base.h
parent4a6a08309cd78091246a7fd598bc43cd25deba45 (diff)
downloadmariadb-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.h')
-rw-r--r--sql/sql_base.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 44d107376b0..6c20022f7ee 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -315,6 +315,13 @@ int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
int read_statistics_for_table(THD *thd, TABLE *table);
int collect_statistics_for_table(THD *thd, TABLE *table);
int update_statistics_for_table(THD *thd, TABLE *table);
+int delete_statistics_for_table(THD *thd, LEX_STRING *db, LEX_STRING *tab);
+int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col);
+int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info);
+int rename_table_in_stat_tables(THD *thd, LEX_STRING *db, LEX_STRING *tab,
+ LEX_STRING *new_db, LEX_STRING *new_tab);
+int rename_column_in_stat_tables(THD *thd, TABLE *tab, Field *col,
+ const char *new_name);
void set_statistics_for_table(THD *thd, TABLE *table);
extern "C" int simple_raw_key_cmp(void* arg, const void* key1,