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
1
/* Copyright (C) 2000-2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20
16
#ifndef DRIZZLE_SERVER_SQL_PARSE_H
21
17
#define DRIZZLE_SERVER_SQL_PARSE_H
23
bool begin_trans(Session *session);
24
bool end_active_trans(Session *session);
25
int end_trans(Session *session, enum enum_mysql_completiontype completion);
19
bool begin_trans(THD *thd);
20
bool end_active_trans(THD *thd);
21
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
27
bool execute_sqlcom_select(Session *session, TableList *all_tables);
28
bool multi_update_precheck(Session *session, TableList *tables);
29
bool multi_delete_precheck(Session *session, TableList *tables);
30
int mysql_multi_update_prepare(Session *session);
31
int mysql_multi_delete_prepare(Session *session);
32
bool mysql_insert_select_prepare(Session *session);
33
bool update_precheck(Session *session, TableList *tables);
34
bool delete_precheck(Session *session, TableList *tables);
35
bool insert_precheck(Session *session, TableList *tables);
36
bool create_table_precheck(Session *session, TableList *tables,
23
bool execute_sqlcom_select(THD *thd, TableList *all_tables);
24
bool multi_update_precheck(THD *thd, TableList *tables);
25
bool multi_delete_precheck(THD *thd, TableList *tables);
26
int mysql_multi_update_prepare(THD *thd);
27
int mysql_multi_delete_prepare(THD *thd);
28
bool mysql_insert_select_prepare(THD *thd);
29
bool update_precheck(THD *thd, TableList *tables);
30
bool delete_precheck(THD *thd, TableList *tables);
31
bool insert_precheck(THD *thd, TableList *tables);
32
bool create_table_precheck(THD *thd, TableList *tables,
37
33
TableList *create_table);
38
bool parse_sql(Session *session, class Lex_input_stream *lip);
34
bool parse_sql(THD *thd, class Lex_input_stream *lip);
40
Item *negate_expression(Session *session, Item *expr);
36
Item *negate_expression(THD *thd, Item *expr);
42
38
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)
40
bool check_identifier_name(LEX_STRING *str, uint max_char_length,
41
uint err_code, const char *param_for_err_msg);
42
inline bool check_identifier_name(LEX_STRING *str, uint err_code)
48
44
return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");