17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SQL_PARSE_H
21
#define DRIZZLED_SQL_PARSE_H
23
#include "drizzled/definitions.h"
24
#include "drizzled/common.h"
25
#include "drizzled/lex_string.h"
26
#include "drizzled/comp_creator.h"
27
#include "drizzled/identifier.h"
34
class Lex_input_stream;
40
typedef struct charset_info_st CHARSET_INFO;
42
extern const LEX_STRING command_name[];
44
bool execute_sqlcom_select(Session *session, TableList *all_tables);
45
bool mysql_insert_select_prepare(Session *session);
46
bool update_precheck(Session *session, TableList *tables);
47
bool delete_precheck(Session *session, TableList *tables);
48
bool insert_precheck(Session *session, TableList *tables);
50
Item *negate_expression(Session *session, Item *expr);
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= "");
20
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
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,
37
TableList *create_table);
38
bool parse_sql(THD *thd, class Lex_input_stream *lip);
40
Item *negate_expression(THD *thd, Item *expr);
42
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, "");
56
55
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
57
56
uint32_t max_byte_length);
59
58
uint32_t max_char_length, const CHARSET_INFO * const cs,
63
bool mysql_test_parse_for_slave(Session *session, char *inBuf,
66
void mysql_reset_session_for_next_command(Session *session);
68
void create_select_for_variable(const char *var_name);
70
void init_update_queries(void);
72
bool dispatch_command(enum enum_server_command command, Session *session,
73
char* packet, uint32_t packet_length);
75
bool check_simple_select();
77
void mysql_init_select(LEX *lex);
78
bool mysql_new_select(LEX *lex, bool move_down);
80
int prepare_new_schema_table(Session *session, LEX *lex,
81
const std::string& schema_table_name);
83
Item * all_any_subquery_creator(Item *left_expr,
84
chooser_compare_func_creator cmp,
86
Select_Lex *select_lex);
88
char* query_table_status(Session *session,const char *db,const char *table_name);
90
} /* namespace drizzled */
92
#endif /* DRIZZLED_SQL_PARSE_H */
61
#endif /* DRIZZLE_SERVER_SQL_PARSE_H */