1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
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/table_identifier.h>
32
class Lex_input_stream;
38
typedef struct charset_info_st CHARSET_INFO;
40
extern const LEX_STRING command_name[];
42
bool execute_sqlcom_select(Session *session, TableList *all_tables);
43
bool mysql_insert_select_prepare(Session *session);
44
bool update_precheck(Session *session, TableList *tables);
45
bool delete_precheck(Session *session, TableList *tables);
46
bool insert_precheck(Session *session, TableList *tables);
47
bool create_table_precheck(drizzled::TableIdentifier &identifier);
49
Item *negate_expression(Session *session, Item *expr);
51
bool check_identifier_name(LEX_STRING *str, uint32_t err_code= 0,
52
uint32_t max_char_length= NAME_CHAR_LEN,
53
const char *param_for_err_msg= "");
55
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
56
uint32_t max_byte_length);
57
bool check_string_char_length(LEX_STRING *str, const char *err_msg,
58
uint32_t max_char_length, const CHARSET_INFO * const cs,
62
bool mysql_test_parse_for_slave(Session *session, char *inBuf,
65
void mysql_reset_session_for_next_command(Session *session);
67
void create_select_for_variable(const char *var_name);
69
void init_update_queries(void);
71
bool dispatch_command(enum enum_server_command command, Session *session,
72
char* packet, uint32_t packet_length);
74
bool check_simple_select();
76
void mysql_init_select(LEX *lex);
77
bool mysql_new_select(LEX *lex, bool move_down);
79
int prepare_schema_table(Session *session, LEX *lex, Table_ident *table_ident,
80
const std::string& schema_table_name);
82
Item * all_any_subquery_creator(Item *left_expr,
83
chooser_compare_func_creator cmp,
85
Select_Lex *select_lex);
87
void sql_kill(Session *session, unsigned long id, bool only_kill_query);
88
char* query_table_status(Session *session,const char *db,const char *table_name);
90
#endif /* DRIZZLED_SQL_PARSE_H */