From 302352723e8fbf69b9d02604c84a79fa56e69b7b Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Tue, 8 Dec 2009 17:13:12 +0300 Subject: Backport of: ---------------------------------------------------------- revno: 2617.69.24 committer: Konstantin Osipov branch nick: 5.4-42546 timestamp: Fri 2009-08-14 19:22:05 +0400 message: A pre-requisite for a fix for Bug#42546 "Backup: RESTORE fails, thinking it finds an existing table" Back-port from WL 148 "Foreign keys" feature tree a patch that introduced Prelocking_strategy class -- a way to parameterize open_tables() behaviour, implemented by Dmitry Lenev. (Part of WL#4284). sql/sql_base.cc: Implement different prelocking strategies. Use an instance of prelocking_strategy in open_tables(). sql/sql_class.h: Add declarations for class Prelocking_strategy. sql/sql_lex.h: Add a helper method to access last table of the global table list (lex->query_tables). sql/sql_parse.cc: Use a special prelocking strategy when locking tables for LOCK TABLES. sql/sql_table.cc: Use normal open_and_lock_tables_derived() in ALTER TABLE. sql/sql_yacc.yy: Modify the grammar to not pollute the global table list with tables that should not be opened. --- sql/sql_trigger.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/sql_trigger.h') diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index b411acf2ac5..85b2dbe5f21 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -144,8 +144,10 @@ public: void mark_fields_used(trg_event_type event); friend class Item_trigger_field; - friend int sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, - TABLE_LIST *table); + + bool add_tables_and_routines_for_triggers(THD *thd, + Query_tables_list *prelocking_ctx, + TABLE_LIST *table_list); private: bool prepare_record1_accessors(TABLE *table); -- cgit v1.2.1