575.4.7
by Monty Taylor
More header cleanup. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
5 |
*
|
|
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.
|
|
9 |
*
|
|
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.
|
|
14 |
*
|
|
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
|
|
18 |
*/
|
|
19 |
||
20 |
#ifndef DRIZZLED_SQL_BASE_H
|
|
21 |
#define DRIZZLED_SQL_BASE_H
|
|
22 |
||
23 |
#include <stdint.h> |
|
798.2.22
by Brian Aker
Removing include structures to old replication |
24 |
#include <drizzled/table.h> |
575.4.7
by Monty Taylor
More header cleanup. |
25 |
|
1000.1.3
by Brian Aker
Renamed TABLE_SHARE to TableShare |
26 |
class TableShare; |
575.4.7
by Monty Taylor
More header cleanup. |
27 |
|
28 |
void table_cache_free(void); |
|
29 |
bool table_cache_init(void); |
|
1000.1.3
by Brian Aker
Renamed TABLE_SHARE to TableShare |
30 |
void assign_new_table_id(TableShare *share); |
575.4.7
by Monty Taylor
More header cleanup. |
31 |
uint32_t cached_open_tables(void); |
32 |
uint32_t cached_table_definitions(void); |
|
33 |
||
34 |
void kill_drizzle(void); |
|
35 |
||
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
36 |
/* sql_base.cc */
|
37 |
void set_item_name(Item *item,char *pos,uint32_t length); |
|
38 |
bool add_field_to_list(Session *session, LEX_STRING *field_name, enum enum_field_types type, |
|
1109.1.5
by Brian Aker
More extraction from sql_base |
39 |
char *length, char *decimal, |
40 |
uint32_t type_modifier, |
|
41 |
enum column_format_type column_format, |
|
42 |
Item *default_value, Item *on_update_value, |
|
43 |
LEX_STRING *comment, |
|
44 |
char *change, List<String> *interval_list, |
|
45 |
const CHARSET_INFO * const cs); |
|
1052.2.3
by Nathan Williams
No actual code changes. Changed Create_field to CreateField to be consistent with coding standards. |
46 |
CreateField * new_create_field(Session *session, char *field_name, enum_field_types type, |
1109.1.5
by Brian Aker
More extraction from sql_base |
47 |
char *length, char *decimals, |
48 |
uint32_t type_modifier, |
|
49 |
Item *default_value, Item *on_update_value, |
|
50 |
LEX_STRING *comment, char *change, |
|
51 |
List<String> *interval_list, CHARSET_INFO *cs); |
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
52 |
void store_position_for_column(const char *name); |
53 |
bool push_new_name_resolution_context(Session *session, |
|
54 |
TableList *left_op, |
|
55 |
TableList *right_op); |
|
56 |
void add_join_on(TableList *b,Item *expr); |
|
57 |
void add_join_natural(TableList *a,TableList *b,List<String> *using_fields, |
|
846
by Brian Aker
Removing on typedeffed class. |
58 |
Select_Lex *lex); |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
59 |
|
60 |
SQL_SELECT *make_select(Table *head, table_map const_tables, |
|
61 |
table_map read_tables, COND *conds, |
|
62 |
bool allow_null_cond, int *error); |
|
63 |
extern Item **not_found_item; |
|
64 |
||
1055.2.13
by Jay Pipes
Documentation and style fixes in Session class. Doxygen should finally pick up the Statement and Session classes now. Removes the silly Query_arena class, as it's not needed anymore. |
65 |
/**
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
66 |
A set of constants used for checking non aggregated fields and sum
|
67 |
functions mixture in the ONLY_FULL_GROUP_BY_MODE.
|
|
68 |
*/
|
|
1089.6.3
by Padraig O'Sullivan
Replaced an instance where a uint8_t type was being used to hold a |
69 |
enum enum_group_by_mode_type |
70 |
{
|
|
71 |
NON_AGG_FIELD_USED= 0, |
|
72 |
SUM_FUNC_USED
|
|
73 |
};
|
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
74 |
|
1055.2.13
by Jay Pipes
Documentation and style fixes in Session class. Doxygen should finally pick up the Statement and Session classes now. Removes the silly Query_arena class, as it's not needed anymore. |
75 |
/**
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
76 |
This enumeration type is used only by the function find_item_in_list
|
77 |
to return the info on how an item has been resolved against a list
|
|
78 |
of possibly aliased items.
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
79 |
The item can be resolved:
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
80 |
- against an alias name of the list's element (RESOLVED_AGAINST_ALIAS)
|
81 |
- against non-aliased field name of the list (RESOLVED_WITH_NO_ALIAS)
|
|
82 |
- against an aliased field name of the list (RESOLVED_BEHIND_ALIAS)
|
|
83 |
- ignoring the alias name in cases when SQL requires to ignore aliases
|
|
84 |
(e.g. when the resolved field reference contains a table name or
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
85 |
when the resolved item is an expression) (RESOLVED_IGNORING_ALIAS)
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
86 |
*/
|
87 |
enum enum_resolution_type { |
|
88 |
NOT_RESOLVED=0, |
|
89 |
RESOLVED_IGNORING_ALIAS, |
|
90 |
RESOLVED_BEHIND_ALIAS, |
|
91 |
RESOLVED_WITH_NO_ALIAS, |
|
92 |
RESOLVED_AGAINST_ALIAS
|
|
93 |
};
|
|
94 |
Item ** find_item_in_list(Item *item, List<Item> &items, uint32_t *counter, |
|
95 |
find_item_error_report_type report_error, |
|
96 |
enum_resolution_type *resolution); |
|
97 |
bool insert_fields(Session *session, Name_resolution_context *context, |
|
1109.1.5
by Brian Aker
More extraction from sql_base |
98 |
const char *db_name, const char *table_name, |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
99 |
List_iterator<Item> *it, bool any_privileges); |
100 |
bool setup_tables(Session *session, Name_resolution_context *context, |
|
101 |
List<TableList> *from_clause, TableList *tables, |
|
102 |
TableList **leaves, bool select_insert); |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
103 |
bool setup_tables_and_check_access(Session *session, |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
104 |
Name_resolution_context *context, |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
105 |
List<TableList> *from_clause, |
106 |
TableList *tables, |
|
107 |
TableList **leaves, |
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
108 |
bool select_insert); |
1034.1.7
by Brian Aker
Remove dead bits to the end of functions. |
109 |
int setup_wild(Session *session, List<Item> &fields, |
110 |
List<Item> *sum_func_list, |
|
111 |
uint32_t wild_num); |
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
112 |
bool setup_fields(Session *session, Item** ref_pointer_array, |
113 |
List<Item> &item, enum_mark_columns mark_used_columns, |
|
114 |
List<Item> *sum_func_list, bool allow_sum_func); |
|
115 |
inline bool setup_fields_with_no_wrap(Session *session, Item **ref_pointer_array, |
|
116 |
List<Item> &item, |
|
117 |
enum_mark_columns mark_used_columns, |
|
118 |
List<Item> *sum_func_list, |
|
119 |
bool allow_sum_func) |
|
120 |
{
|
|
121 |
bool res; |
|
122 |
res= setup_fields(session, ref_pointer_array, item, mark_used_columns, sum_func_list, |
|
123 |
allow_sum_func); |
|
124 |
return res; |
|
125 |
}
|
|
1034.1.7
by Brian Aker
Remove dead bits to the end of functions. |
126 |
int setup_conds(Session *session, TableList *leaves, COND **conds); |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
127 |
/* open_and_lock_tables with optional derived handling */
|
128 |
TableList *find_table_in_list(TableList *table, |
|
129 |
TableList *TableList::*link, |
|
130 |
const char *db_name, |
|
131 |
const char *table_name); |
|
1220.1.13
by Brian Aker
Remove mysql_lock_have_duplicate() (we don't have merge, and our partition |
132 |
TableList *unique_table(TableList *table, TableList *table_list, |
133 |
bool check_alias= false); |
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
134 |
void remove_db_from_cache(const char *db); |
135 |
||
136 |
/* bits for last argument to remove_table_from_cache() */
|
|
137 |
#define RTFC_NO_FLAG 0x0000
|
|
138 |
#define RTFC_OWNED_BY_Session_FLAG 0x0001
|
|
139 |
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
|
|
140 |
#define RTFC_CHECK_KILLED_FLAG 0x0004
|
|
141 |
bool remove_table_from_cache(Session *session, const char *db, const char *table, |
|
142 |
uint32_t flags); |
|
143 |
||
144 |
void mem_alloc_error(size_t size); |
|
145 |
||
1109.1.4
by Brian Aker
More Table refactor |
146 |
bool fill_record(Session* session, List<Item> &fields, List<Item> &values, bool ignore_errors); |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
147 |
bool fill_record(Session *session, Field **field, List<Item> &values, bool ignore_errors); |
1093.6.2
by Brian Aker
Small optimization to make table listing simpler |
148 |
bool list_open_tables(const char *db, const char *wild, bool(*func)(Table *table, open_table_list_st& open_list), Table *display); |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
149 |
|
150 |
inline TableList *find_table_in_global_list(TableList *table, |
|
151 |
const char *db_name, |
|
152 |
const char *table_name) |
|
153 |
{
|
|
154 |
return find_table_in_list(table, &TableList::next_global, |
|
155 |
db_name, table_name); |
|
156 |
}
|
|
575.4.7
by Monty Taylor
More header cleanup. |
157 |
#endif /* DRIZZLED_SQL_BASE_H */ |