20
20
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
21
21
#define DRIZZLE_SERVER_SQL_PARSE_H
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
typedef class st_select_lex SELECT_LEX;
23
41
bool begin_trans(Session *session);
24
42
bool end_active_trans(Session *session);
25
43
int end_trans(Session *session, enum enum_mysql_completiontype completion);
35
53
bool insert_precheck(Session *session, TableList *tables);
36
54
bool create_table_precheck(Session *session, TableList *tables,
37
55
TableList *create_table);
38
bool parse_sql(Session *session, class Lex_input_stream *lip);
56
bool parse_sql(Session *session, Lex_input_stream *lip);
40
58
Item *negate_expression(Session *session, Item *expr);
42
60
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, "");
62
bool check_identifier_name(LEX_STRING *str, uint32_t err_code= 0,
63
uint32_t max_char_length= NAME_CHAR_LEN,
64
const char *param_for_err_msg= "");
55
66
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
56
67
uint32_t max_byte_length);
58
69
uint32_t max_char_length, const CHARSET_INFO * const cs,
73
void mysql_parse(Session *session, const char *inBuf, uint32_t length,
74
const char ** semicolon);
76
bool mysql_test_parse_for_slave(Session *session, char *inBuf,
79
bool is_update_query(enum enum_sql_command command);
81
bool alloc_query(Session *session, const char *packet, uint32_t packet_length);
83
void mysql_reset_session_for_next_command(Session *session);
85
void create_select_for_variable(const char *var_name);
87
void mysql_init_multi_delete(LEX *lex);
89
bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
91
void init_update_queries(void);
93
bool do_command(Session *session);
95
bool dispatch_command(enum enum_server_command command, Session *session,
96
char* packet, uint32_t packet_length);
98
void log_slow_statement(Session *session);
100
bool append_file_to_dir(Session *session, const char **filename_ptr,
101
const char *table_name);
103
bool reload_cache(Session *session, ulong options, TableList *tables,
104
bool *write_to_binlog);
106
bool check_simple_select();
108
void mysql_init_select(LEX *lex);
109
bool mysql_new_select(LEX *lex, bool move_down);
111
int prepare_schema_table(Session *session, LEX *lex, Table_ident *table_ident,
112
enum enum_schema_tables schema_table_idx);
114
Item * all_any_subquery_creator(Item *left_expr,
115
chooser_compare_func_creator cmp,
117
SELECT_LEX *select_lex);
61
119
#endif /* DRIZZLE_SERVER_SQL_PARSE_H */