~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.h

  • Committer: Monty Taylor
  • Date: 2008-10-07 19:30:18 UTC
  • mfrom: (322.2.8 stdize-code)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: monty@inaugust.com-20081007193018-22fhaywc990akeqa
Merged code from Mats that I should have merged a while ago.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
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
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_SQL_PARSE_H
21
 
#define DRIZZLED_SQL_PARSE_H
22
 
 
23
 
#include <string>
24
 
 
25
 
#include <drizzled/definitions.h>
26
 
#include <drizzled/common.h>
27
 
#include <drizzled/lex_string.h>
28
 
#include <drizzled/comp_creator.h>
29
 
#include <drizzled/identifier.h>
30
 
 
31
 
#include <drizzled/error_t.h>
32
 
#include <drizzled/visibility.h>
33
 
 
34
 
namespace drizzled
35
 
{
36
 
 
37
 
class Session;
38
 
class TableList;
39
 
class Lex_input_stream;
40
 
class Item;
41
 
class LEX;
42
 
class Table_ident;
43
 
class Select_Lex;
44
 
 
45
 
typedef struct charset_info_st CHARSET_INFO;
46
 
 
47
 
DRIZZLED_API const std::string &getCommandName(const enum_server_command& command);
48
 
 
49
 
bool execute_sqlcom_select(Session *session, TableList *all_tables);
50
 
bool insert_select_prepare(Session *session);
51
 
bool update_precheck(Session *session, TableList *tables);
52
 
bool delete_precheck(Session *session, TableList *tables);
53
 
bool insert_precheck(Session *session, TableList *tables);
54
 
 
55
 
Item *negate_expression(Session *session, Item *expr);
56
 
 
57
 
bool check_identifier_name(LEX_STRING *str, error_t err_code= EE_OK,
58
 
                           uint32_t max_char_length= NAME_CHAR_LEN,
59
 
                           const char *param_for_err_msg= "");
 
20
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
 
21
#define DRIZZLE_SERVER_SQL_PARSE_H
 
22
 
 
23
bool begin_trans(THD *thd);
 
24
bool end_active_trans(THD *thd);
 
25
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
 
26
 
 
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);
 
39
 
 
40
Item *negate_expression(THD *thd, Item *expr);
 
41
 
 
42
bool test_if_data_home_dir(const char *dir);
 
43
 
 
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)
 
47
{
 
48
  return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");
 
49
}
 
50
inline bool check_identifier_name(LEX_STRING *str)
 
51
{
 
52
  return check_identifier_name(str, NAME_CHAR_LEN, 0, "");
 
53
}
60
54
 
61
55
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
62
56
                              uint32_t max_byte_length);
64
58
                              uint32_t max_char_length, const CHARSET_INFO * const cs,
65
59
                              bool no_error);
66
60
 
67
 
 
68
 
bool test_parse_for_slave(Session *session, char *inBuf,
69
 
                                uint32_t length);
70
 
 
71
 
void reset_session_for_next_command(Session *session);
72
 
 
73
 
void create_select_for_variable(Session *session, const char *var_name);
74
 
 
75
 
void init_update_queries(void);
76
 
 
77
 
bool dispatch_command(enum enum_server_command command, Session *session,
78
 
                      char* packet, uint32_t packet_length);
79
 
 
80
 
bool check_simple_select(Session* session);
81
 
 
82
 
void init_select(LEX *lex);
83
 
bool new_select(LEX *lex, bool move_down);
84
 
 
85
 
int prepare_new_schema_table(Session *session, LEX *lex,
86
 
                             const std::string& schema_table_name);
87
 
 
88
 
Item * all_any_subquery_creator(Item *left_expr,
89
 
                                chooser_compare_func_creator cmp,
90
 
                                bool all,
91
 
                                Select_Lex *select_lex);
92
 
 
93
 
char* query_table_status(Session *session,const char *db,const char *table_name);
94
 
 
95
 
} /* namespace drizzled */
96
 
 
97
 
#endif /* DRIZZLED_SQL_PARSE_H */
 
61
#endif /* DRIZZLE_SERVER_SQL_PARSE_H */