20
20
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
21
21
#define DRIZZLE_SERVER_SQL_PARSE_H
23
bool begin_trans(THD *thd);
24
bool end_active_trans(THD *thd);
25
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
27
bool execute_sqlcom_select(THD *thd, TableList *all_tables);
28
bool multi_update_precheck(THD *thd, TableList *tables);
29
bool multi_delete_precheck(THD *thd, TableList *tables);
30
int mysql_multi_update_prepare(THD *thd);
31
int mysql_multi_delete_prepare(THD *thd);
32
bool mysql_insert_select_prepare(THD *thd);
33
bool update_precheck(THD *thd, TableList *tables);
34
bool delete_precheck(THD *thd, TableList *tables);
35
bool insert_precheck(THD *thd, TableList *tables);
36
bool create_table_precheck(THD *thd, TableList *tables,
25
#include <drizzled/definitions.h>
26
#include <drizzled/common.h>
27
#include <drizzled/lex_string.h>
28
#include <drizzled/comp_creator.h>
30
#include <mystrings/m_ctype.h>
34
class Lex_input_stream;
39
bool execute_sqlcom_select(Session *session, TableList *all_tables);
40
bool mysql_insert_select_prepare(Session *session);
41
bool update_precheck(Session *session, TableList *tables);
42
bool delete_precheck(Session *session, TableList *tables);
43
bool insert_precheck(Session *session, TableList *tables);
44
bool create_table_precheck(Session *session, TableList *tables,
37
45
TableList *create_table);
38
bool parse_sql(THD *thd, class Lex_input_stream *lip);
46
bool parse_sql(Session *session, Lex_input_stream *lip);
40
Item *negate_expression(THD *thd, Item *expr);
48
Item *negate_expression(Session *session, Item *expr);
42
50
bool test_if_data_home_dir(const char *dir);
44
bool check_identifier_name(LEX_STRING *str, uint32_t max_char_length,
45
uint32_t err_code, const char *param_for_err_msg);
46
inline bool check_identifier_name(LEX_STRING *str, uint32_t err_code)
48
return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");
50
inline bool check_identifier_name(LEX_STRING *str)
52
return check_identifier_name(str, NAME_CHAR_LEN, 0, "");
52
bool check_identifier_name(LEX_STRING *str, uint32_t err_code= 0,
53
uint32_t max_char_length= NAME_CHAR_LEN,
54
const char *param_for_err_msg= "");
55
56
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
56
57
uint32_t max_byte_length);
58
59
uint32_t max_char_length, const CHARSET_INFO * const cs,
63
void mysql_parse(Session *session, const char *inBuf, uint32_t length,
64
const char ** semicolon);
66
bool mysql_test_parse_for_slave(Session *session, char *inBuf,
69
bool is_update_query(enum enum_sql_command command);
71
void mysql_reset_session_for_next_command(Session *session);
73
void create_select_for_variable(const char *var_name);
75
void init_update_queries(void);
77
bool dispatch_command(enum enum_server_command command, Session *session,
78
char* packet, uint32_t packet_length);
80
bool check_simple_select();
82
void mysql_init_select(LEX *lex);
83
bool mysql_new_select(LEX *lex, bool move_down);
85
int prepare_schema_table(Session *session, LEX *lex, Table_ident *table_ident,
86
const std::string& schema_table_name);
88
Item * all_any_subquery_creator(Item *left_expr,
89
chooser_compare_func_creator cmp,
91
Select_Lex *select_lex);
61
93
#endif /* DRIZZLE_SERVER_SQL_PARSE_H */