16 #ifndef SQL_PARSE_INCLUDED
17 #define SQL_PARSE_INCLUDED
19 #include "my_global.h"
31 enum enum_mysql_completiontype {
32 ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7,
33 COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6
36 extern "C" int test_if_data_home_dir(
const char *dir);
38 bool stmt_causes_implicit_commit(
const THD *thd, uint mask);
44 int mysql_multi_update_prepare(THD *thd);
45 int mysql_multi_delete_prepare(THD *thd, uint *table_count);
46 bool mysql_insert_select_prepare(THD *thd);
54 Parser_state *parser_state,
59 void free_items(
Item *item);
70 enum enum_schema_tables schema_table_idx);
76 uint max_byte_length);
77 bool check_string_char_length(
LEX_STRING *str,
const char *err_msg,
83 bool check_identifier_name(
LEX_STRING *str, uint max_char_length,
84 uint err_code,
const char *param_for_err_msg);
85 bool mysql_test_parse_for_slave(THD *thd,
char *inBuf,uint length);
86 bool is_update_query(
enum enum_sql_command command);
87 bool is_explainable_query(
enum enum_sql_command command);
89 bool alloc_query(THD *thd,
const char *packet, uint packet_length);
91 void mysql_parse(THD *thd,
char *rawbuf, uint length,
92 Parser_state *parser_state);
97 void mysql_init_multi_delete(LEX *lex);
103 void do_handle_bootstrap(THD *thd);
105 char* packet, uint packet_length);
113 void execute_init_command(THD *thd,
LEX_STRING *init_command,
116 char *length,
char *decimal,
118 Item *default_value,
Item *on_update_value,
122 uint uint_geom_type);
127 bool push_new_name_resolution_context(THD *thd,
131 void init_update_queries(
void);
138 extern const char* any_db;
140 extern uint server_command_flags[];
142 extern uint server_command_flags[];
145 inline bool check_identifier_name(
LEX_STRING *str, uint err_code)
147 return check_identifier_name(str, NAME_CHAR_LEN, err_code,
"");
150 inline bool check_identifier_name(
LEX_STRING *str)
152 return check_identifier_name(str, NAME_CHAR_LEN, 0,
"");
155 #ifndef NO_EMBEDDED_ACCESS_CHECKS
159 bool check_routine_access(THD *thd,ulong want_access,
char *db,
char *
name,
160 bool is_proc,
bool no_errors);
163 bool check_access(THD *thd, ulong want_access,
const char *db, ulong *save_priv,
165 bool dont_check_global_grants,
bool no_errors);
167 bool any_combination_of_privileges_will_do,
176 inline bool check_routine_access(THD *thd,ulong want_access,
char *db,
177 char *
name,
bool is_proc,
bool no_errors)
185 const char *
name,
bool is_proc)
187 inline bool check_access(THD *, ulong,
const char *, ulong *save_priv,
191 *save_priv= GLOBAL_ACLS;
196 bool any_combination_of_privileges_will_do,
206 inline bool is_supported_parser_charset(
const CHARSET_INFO *cs)
208 return (cs->mbminlen == 1);
211 extern "C" bool sqlcom_can_generate_row_events(
const THD *thd);