From c6d3f8058db30a6621e36b05564a1b2ae68bec7f Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 8 Dec 2014 10:56:08 +0400 Subject: MDEV-7112 Split HA_CREATE_INFO --- sql/sql_base.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 6 deletions(-) (limited to 'sql/sql_base.h') diff --git a/sql/sql_base.h b/sql/sql_base.h index e39ec16028b..0041972f101 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -226,15 +226,41 @@ int setup_conds(THD *thd, TABLE_LIST *tables, List &leaves, void wrap_ident(THD *thd, Item **conds); int setup_ftfuncs(SELECT_LEX* select); int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order); -bool lock_table_names(THD *thd, TABLE_LIST *table_list, +bool lock_table_names(THD *thd, const DDL_options_st &options, + TABLE_LIST *table_list, TABLE_LIST *table_list_end, ulong lock_wait_timeout, uint flags); -bool open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags, +static inline bool +lock_table_names(THD *thd, TABLE_LIST *table_list, + TABLE_LIST *table_list_end, ulong lock_wait_timeout, + uint flags) +{ + return lock_table_names(thd, thd->lex->create_info, table_list, + table_list_end, lock_wait_timeout, flags); +} +bool open_tables(THD *thd, const DDL_options_st &options, + TABLE_LIST **tables, uint *counter, uint flags, Prelocking_strategy *prelocking_strategy); +static inline bool +open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags, + Prelocking_strategy *prelocking_strategy) +{ + return open_tables(thd, thd->lex->create_info, tables, counter, flags, + prelocking_strategy); +} /* open_and_lock_tables with optional derived handling */ -bool open_and_lock_tables(THD *thd, TABLE_LIST *tables, +bool open_and_lock_tables(THD *thd, const DDL_options_st &options, + TABLE_LIST *tables, bool derived, uint flags, Prelocking_strategy *prelocking_strategy); +static inline bool +open_and_lock_tables(THD *thd, TABLE_LIST *tables, + bool derived, uint flags, + Prelocking_strategy *prelocking_strategy) +{ + return open_and_lock_tables(thd, thd->lex->create_info, + tables, derived, flags, prelocking_strategy); +} /* simple open_and_lock_tables without derived handling for single table */ TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, thr_lock_type lock_type, uint flags, @@ -459,12 +485,22 @@ public: }; +inline bool +open_tables(THD *thd, const DDL_options_st &options, + TABLE_LIST **tables, uint *counter, uint flags) +{ + DML_prelocking_strategy prelocking_strategy; + + return open_tables(thd, options, tables, counter, flags, + &prelocking_strategy); +} inline bool open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags) { DML_prelocking_strategy prelocking_strategy; - return open_tables(thd, tables, counter, flags, &prelocking_strategy); + return open_tables(thd, thd->lex->create_info, tables, counter, flags, + &prelocking_strategy); } inline TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, @@ -478,12 +514,23 @@ inline TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, /* open_and_lock_tables with derived handling */ -inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables, +inline bool open_and_lock_tables(THD *thd, + const DDL_options_st &options, + TABLE_LIST *tables, bool derived, uint flags) { DML_prelocking_strategy prelocking_strategy; - return open_and_lock_tables(thd, tables, derived, flags, + return open_and_lock_tables(thd, options, tables, derived, flags, + &prelocking_strategy); +} +inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables, + bool derived, uint flags) +{ + DML_prelocking_strategy prelocking_strategy; + + return open_and_lock_tables(thd, thd->lex->create_info, + tables, derived, flags, &prelocking_strategy); } -- cgit v1.2.1