From a7e352b54ddfaf91c92951d605cb02a4ffd2676b Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 7 Jan 2018 18:03:44 +0200 Subject: Changed database, tablename and alias to be LEX_CSTRING This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "") --- sql/sql_trigger.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'sql/sql_trigger.h') diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index 6c02afdb89c..0fddb94fde1 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -223,17 +223,17 @@ public: bool old_row_is_record1); void empty_lists(); bool create_lists_needed_for_files(MEM_ROOT *root); - bool save_trigger_file(THD *thd, const char *db, const char *table_name); + bool save_trigger_file(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name); - static bool check_n_load(THD *thd, const char *db, const char *table_name, + static bool check_n_load(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name, TABLE *table, bool names_only); - static bool drop_all_triggers(THD *thd, const char *db, - const char *table_name); - static bool change_table_name(THD *thd, const char *db, - const char *old_alias, - const char *old_table, - const char *new_db, - const char *new_table); + static bool drop_all_triggers(THD *thd, const LEX_CSTRING *db, + const LEX_CSTRING *table_name); + static bool change_table_name(THD *thd, const LEX_CSTRING *db, + const LEX_CSTRING *old_alias, + const LEX_CSTRING *old_table, + const LEX_CSTRING *new_db, + const LEX_CSTRING *new_table); void add_trigger(trg_event_type event_type, trg_action_time_type action_time, trigger_order_type ordering_clause, @@ -286,15 +286,15 @@ public: private: bool prepare_record_accessors(TABLE *table); - Trigger *change_table_name_in_trignames(const char *old_db_name, - const char *new_db_name, - LEX_CSTRING *new_table_name, + Trigger *change_table_name_in_trignames(const LEX_CSTRING *old_db_name, + const LEX_CSTRING *new_db_name, + const LEX_CSTRING *new_table_name, Trigger *trigger); bool change_table_name_in_triggers(THD *thd, - const char *old_db_name, - const char *new_db_name, - LEX_CSTRING *old_table_name, - LEX_CSTRING *new_table_name); + const LEX_CSTRING *old_db_name, + const LEX_CSTRING *new_db_name, + const LEX_CSTRING *old_table_name, + const LEX_CSTRING *new_table_name); bool check_for_broken_triggers() { @@ -314,7 +314,7 @@ bool add_table_for_trigger(THD *thd, void build_trn_path(THD *thd, const sp_name *trg_name, LEX_STRING *trn_path); -bool check_trn_exists(const LEX_STRING *trn_path); +bool check_trn_exists(const LEX_CSTRING *trn_path); bool load_table_name_for_trigger(THD *thd, const sp_name *trg_name, -- cgit v1.2.1