1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Copyright (C) 2008 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
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
20
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
21
#define DRIZZLE_SERVER_SQL_PARSE_H
25
25
#include <drizzled/definitions.h>
26
26
#include <drizzled/common.h>
27
27
#include <drizzled/lex_string.h>
28
28
#include <drizzled/comp_creator.h>
29
#include <drizzled/identifier.h>
31
#include <drizzled/error_t.h>
32
#include <drizzled/visibility.h>
30
#include <mystrings/m_ctype.h>
45
typedef struct charset_info_st CHARSET_INFO;
47
DRIZZLED_API const std::string &getCommandName(const enum_server_command& command);
39
typedef class Select_Lex Select_Lex;
41
bool begin_trans(Session *session);
42
bool end_active_trans(Session *session);
43
int end_trans(Session *session, enum enum_mysql_completiontype completion);
49
45
bool execute_sqlcom_select(Session *session, TableList *all_tables);
50
bool insert_select_prepare(Session *session);
46
bool multi_update_precheck(Session *session, TableList *tables);
47
bool multi_delete_precheck(Session *session, TableList *tables);
48
int mysql_multi_update_prepare(Session *session);
49
int mysql_multi_delete_prepare(Session *session);
50
bool mysql_insert_select_prepare(Session *session);
51
51
bool update_precheck(Session *session, TableList *tables);
52
52
bool delete_precheck(Session *session, TableList *tables);
53
53
bool insert_precheck(Session *session, TableList *tables);
54
bool create_table_precheck(Session *session, TableList *tables,
55
TableList *create_table);
56
bool parse_sql(Session *session, Lex_input_stream *lip);
55
58
Item *negate_expression(Session *session, Item *expr);
57
bool check_identifier_name(LEX_STRING *str, error_t err_code= EE_OK,
60
bool test_if_data_home_dir(const char *dir);
62
bool check_identifier_name(LEX_STRING *str, uint32_t err_code= 0,
58
63
uint32_t max_char_length= NAME_CHAR_LEN,
59
64
const char *param_for_err_msg= "");
68
bool test_parse_for_slave(Session *session, char *inBuf,
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,
71
void reset_session_for_next_command(Session *session);
73
void create_select_for_variable(Session *session, const char *var_name);
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);
75
91
void init_update_queries(void);
93
bool do_command(Session *session);
77
95
bool dispatch_command(enum enum_server_command command, Session *session,
78
96
char* packet, uint32_t packet_length);
80
bool check_simple_select(Session* session);
82
void init_select(LEX *lex);
83
bool new_select(LEX *lex, bool move_down);
85
int prepare_new_schema_table(Session *session, LEX *lex,
86
const std::string& schema_table_name);
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);
88
114
Item * all_any_subquery_creator(Item *left_expr,
89
115
chooser_compare_func_creator cmp,
91
117
Select_Lex *select_lex);
93
char* query_table_status(Session *session,const char *db,const char *table_name);
95
} /* namespace drizzled */
97
#endif /* DRIZZLED_SQL_PARSE_H */
119
#endif /* DRIZZLE_SERVER_SQL_PARSE_H */