同步操作将从 caikang/SQLAdvisor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; version 2 of the License.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */#ifndef SQL_BASE_INCLUDED#define SQL_BASE_INCLUDED#include "unireg.h" // REQUIRED: for other includes#include "sql_trigger.h" /* trg_event_type */#include "sql_class.h" /* enum_mark_columns */#include "mysqld.h" /* key_map */class Item_ident;struct Name_resolution_context;class Open_table_context;class Open_tables_state;class Prelocking_strategy;struct TABLE_LIST;class THD;struct handlerton;typedef class st_select_lex SELECT_LEX;typedef struct st_lock_param_type ALTER_PARTITION_PARAM_TYPE;/*This enumeration type is used only by the function find_item_in_listto return the info on how an item has been resolved against a listof possibly aliased items.The item can be resolved:- against an alias name of the list's element (RESOLVED_AGAINST_ALIAS)- against non-aliased field name of the list (RESOLVED_WITH_NO_ALIAS)- against an aliased field name of the list (RESOLVED_BEHIND_ALIAS)- ignoring the alias name in cases when SQL requires to ignore aliases(e.g. when the resolved field reference contains a table name orwhen the resolved item is an expression) (RESOLVED_IGNORING_ALIAS)*/enum enum_resolution_type {NOT_RESOLVED=0,RESOLVED_IGNORING_ALIAS,RESOLVED_BEHIND_ALIAS,RESOLVED_WITH_NO_ALIAS,RESOLVED_AGAINST_ALIAS};enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND,IGNORE_ERRORS, REPORT_EXCEPT_NON_UNIQUE,IGNORE_EXCEPT_NON_UNIQUE};enum enum_tdc_remove_table_type {TDC_RT_REMOVE_ALL, TDC_RT_REMOVE_NOT_OWN,TDC_RT_REMOVE_UNUSED,TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE};/* bits for last argument to remove_table_from_cache() */#define RTFC_NO_FLAG 0x0000#define RTFC_OWNED_BY_THD_FLAG 0x0001#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002#define RTFC_CHECK_KILLED_FLAG 0x0004bool check_dup(const char *db, const char *name, TABLE_LIST *tables);extern mysql_mutex_t LOCK_open;void table_def_start_shutdown(void);uint cached_table_definitions(void);uint get_table_def_key(const TABLE_LIST *table_list, const char **key);/* mysql_lock_tables() and open_table() flags bits */#define MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK 0x0001#define MYSQL_OPEN_IGNORE_FLUSH 0x0002/* MYSQL_OPEN_TEMPORARY_ONLY (0x0004) is not used anymore. */#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY 0x0008#define MYSQL_LOCK_LOG_TABLE 0x0010/**If in locked tables mode, ignore the locked tables and geta new instance of the table.*/#define MYSQL_OPEN_GET_NEW_TABLE 0x0040/**Open tables using MDL_SHARED_HIGH_PRIO lock instead of one specifiedin parser.*/#define MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL 0x0400/**When opening or locking the table, use the maximum timeout(LONG_TIMEOUT = 1 year) rather than the user-supplied timeout value.*/#define MYSQL_LOCK_IGNORE_TIMEOUT 0x0800/**When opening or locking a replication table through an internaloperation rather than explicitly through an user thread.*/#define MYSQL_LOCK_RPL_INFO_TABLE 0x2000/**Only check THD::killed if waits happen (e.g. wait on MDL, wait ontable flush, wait on thr_lock.c locks) while opening and locking table.*/#define MYSQL_OPEN_IGNORE_KILLED 0x4000/** Please refer to the internals manual. */#define MYSQL_OPEN_REOPEN (MYSQL_OPEN_IGNORE_FLUSH |\MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |\MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |\MYSQL_LOCK_IGNORE_TIMEOUT |\MYSQL_OPEN_IGNORE_KILLED |\MYSQL_OPEN_GET_NEW_TABLE)thr_lock_type read_lock_type_for_table(THD *thd,Query_tables_list *prelocking_ctx,TABLE_LIST *table_list,bool routine_modifies_data);my_bool mysql_rm_tmp_tables(void);bool rm_temporary_table(handlerton *base, const char *path);void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);TABLE_LIST *find_table_in_list(TABLE_LIST *table,TABLE_LIST *TABLE_LIST::*link,const char *db_name,const char *table_name);void close_thread_tables(THD *thd);bool fill_record_n_invoke_before_triggers(THD *thd, List<Item> &fields,List<Item> &values,bool ignore_errors,Table_triggers_list *triggers,enum trg_event_type event);Item ** find_item_in_list(Item *item, List<Item> &items, uint *counter,find_item_error_report_type report_error,enum_resolution_type *resolution);bool setup_tables(THD *thd, Name_resolution_context *context,List<TABLE_LIST> *from_clause, TABLE_LIST *tables,TABLE_LIST **leaves, bool select_insert);bool setup_tables_and_check_access(THD *thd,Name_resolution_context *context,List<TABLE_LIST> *from_clause,TABLE_LIST *tables,TABLE_LIST **leaves,bool select_insert,ulong want_access_first,ulong want_access);void update_non_unique_table_error(TABLE_LIST *update,const char *operation,TABLE_LIST *duplicate);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,TABLE_LIST *table_list_end, ulong lock_wait_timeout,uint flags);bool open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags,Prelocking_strategy *prelocking_strategy);/* open_and_lock_tables with optional derived handling */bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,bool derived, uint flags,Prelocking_strategy *prelocking_strategy);bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags);bool close_temporary_tables(THD *thd);TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,bool check_alias);bool is_equal(const LEX_STRING *a, const LEX_STRING *b);bool is_order_deterministic(List<TABLE_LIST>* join_list,Item *cond, ORDER* order);bool is_order_deterministic(TABLE_LIST *table,Item *cond, ORDER* order);bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool fast_check,bool *exists);extern Item **not_found_item;inline TABLE_LIST *find_table_in_global_list(TABLE_LIST *table,const char *db_name,const char *table_name){return find_table_in_list(table, &TABLE_LIST::next_global,db_name, table_name);}inline TABLE_LIST *find_table_in_local_list(TABLE_LIST *table,const char *db_name,const char *table_name){return find_table_in_list(table, &TABLE_LIST::next_local,db_name, table_name);}/**An abstract class for a strategy specifying how the prelockingalgorithm should extend the prelocking set while processingalready existing elements in the set.*/class Prelocking_strategy{public:virtual ~Prelocking_strategy() { }virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,Sroutine_hash_entry *rt, sp_head *sp,bool *need_prelocking) = 0;virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking) = 0;virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking)= 0;};/**A Strategy for prelocking algorithm suitable for DML statements.Ensures that all tables used by all statement's SF/SP/triggers andrequired for foreign key checks are prelocked and SF/SPs used arecached.*/class DML_prelocking_strategy : public Prelocking_strategy{public:virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,Sroutine_hash_entry *rt, sp_head *sp,bool *need_prelocking);virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking);virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking);};/**A strategy for prelocking algorithm to be used for LOCK TABLESstatement.*/class Lock_tables_prelocking_strategy : public DML_prelocking_strategy{virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking);};/**Strategy for prelocking algorithm to be used for ALTER TABLE statements.Unlike DML or LOCK TABLES strategy, it doesn'tprelock triggers, views or stored routines, since they are notused during ALTER.*/class Alter_table_prelocking_strategy : public Prelocking_strategy{public:virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,Sroutine_hash_entry *rt, sp_head *sp,bool *need_prelocking);virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking);virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,TABLE_LIST *table_list, bool *need_prelocking);};/**This internal handler is used to trap ER_NO_SUCH_TABLE.*/class No_such_table_error_handler : public Internal_error_handler{public:No_such_table_error_handler(): m_handled_errors(0), m_unhandled_errors(0){}bool handle_condition(THD *thd,uint sql_errno,const char* sqlstate,Sql_condition::enum_warning_level level,const char* msg,Sql_condition ** cond_hdl);/**Returns TRUE if one or more ER_NO_SUCH_TABLE errors have beentrapped and no other errors have been seen. FALSE otherwise.*/bool safely_trapped_errors();private:int m_handled_errors;int m_unhandled_errors;};#endif /* SQL_BASE_INCLUDED */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。