390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
4 |
* Copyright (C) 2008 Sun Microsystems, Inc.
|
390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
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; either version 2 of the License, or
|
|
9 |
* (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This program is distributed in the hope that it will be useful,
|
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 |
* GNU General Public License for more details.
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License
|
|
17 |
* along with this program; if not, write to the Free Software
|
|
18 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19 |
*/
|
|
20 |
||
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. |
21 |
#ifndef DRIZZLED_TABLE_LIST_H
|
22 |
#define DRIZZLED_TABLE_LIST_H
|
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
23 |
|
2141.3.1
by vjsamuel1990 at gmail
Merge encapsulate join_read_const_table() into JoinTable. |
24 |
#include <drizzled/nested_join.h> |
584.1.13
by Monty Taylor
Split out a little more code. Removed table_list.h from common_includes. |
25 |
#include <drizzled/table.h> |
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
26 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
27 |
namespace drizzled |
28 |
{
|
|
29 |
||
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
30 |
class Index_hint; |
31 |
class COND_EQUAL; |
|
32 |
class Natural_join_column; |
|
33 |
class select_union; |
|
848
by Brian Aker
typdef class removal (just... use the name of the class). |
34 |
class Select_Lex_Unit; |
846
by Brian Aker
Removing on typedeffed class. |
35 |
class Select_Lex; |
851
by Brian Aker
Class rewrite of Session (aka get all of the junk out) |
36 |
class Tmp_Table_Param; |
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
37 |
class Item_subselect; |
38 |
class Table; |
|
39 |
||
1130.1.1
by Monty Taylor
Merged in plugin-slot-reorg patches. |
40 |
namespace plugin |
41 |
{
|
|
1130.3.9
by Monty Taylor
Wrapped table_proto_write.cc code in namespace drizzled. |
42 |
class StorageEngine; |
1130.1.1
by Monty Taylor
Merged in plugin-slot-reorg patches. |
43 |
}
|
44 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
45 |
/**
|
46 |
* A Table referenced in the FROM clause.
|
|
47 |
*
|
|
48 |
* These table references can be of several types that correspond to
|
|
49 |
* different SQL elements. Below we list all types of TableLists with
|
|
50 |
* the necessary conditions to determine when a TableList instance
|
|
51 |
* belongs to a certain type.
|
|
52 |
*
|
|
53 |
* 1) table (TableList::view == NULL)
|
|
54 |
* - base table
|
|
55 |
* (TableList::derived == NULL)
|
|
56 |
* - subquery - TableList::table is a temp table
|
|
57 |
* (TableList::derived != NULL)
|
|
58 |
*
|
|
59 |
* @note
|
|
60 |
*
|
|
61 |
* for schema tables TableList::field_translation may be != NULL
|
|
62 |
*
|
|
63 |
* 2) Was VIEW
|
|
64 |
* 3) nested table reference (TableList::nested_join != NULL)
|
|
65 |
* - table sequence - e.g. (t1, t2, t3)
|
|
66 |
* @todo how to distinguish from a JOIN?
|
|
67 |
* - general JOIN
|
|
68 |
* @todo how to distinguish from a table sequence?
|
|
69 |
* - NATURAL JOIN
|
|
70 |
* (TableList::natural_join != NULL)
|
|
71 |
* - JOIN ... USING
|
|
72 |
* (TableList::join_using_fields != NULL)
|
|
73 |
* - semi-join
|
|
74 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
75 |
class TableList |
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
76 |
{
|
77 |
public: |
|
1034.1.4
by Brian Aker
Fixed TableList to correctly construct (and removed memset() calls in |
78 |
TableList(): |
79 |
next_local(NULL), |
|
80 |
next_global(NULL), |
|
81 |
prev_global(NULL), |
|
82 |
db(NULL), |
|
83 |
alias(NULL), |
|
84 |
table_name(NULL), |
|
85 |
option(NULL), |
|
86 |
on_expr(NULL), |
|
87 |
table(NULL), |
|
88 |
prep_on_expr(NULL), |
|
89 |
cond_equal(NULL), |
|
90 |
natural_join(NULL), |
|
91 |
is_natural_join(false), |
|
92 |
is_join_columns_complete(false), |
|
93 |
straight(false), |
|
94 |
force_index(false), |
|
95 |
ignore_leaves(false), |
|
96 |
join_using_fields(NULL), |
|
97 |
join_columns(NULL), |
|
98 |
next_name_resolution_table(NULL), |
|
99 |
index_hints(NULL), |
|
100 |
derived_result(NULL), |
|
101 |
derived(NULL), |
|
102 |
schema_select_lex(NULL), |
|
103 |
select_lex(NULL), |
|
104 |
next_leaf(NULL), |
|
105 |
outer_join(0), |
|
106 |
db_length(0), |
|
107 |
table_name_length(0), |
|
108 |
dep_tables(0), |
|
109 |
on_expr_dep_tables(0), |
|
110 |
nested_join(NULL), |
|
111 |
embedding(NULL), |
|
112 |
join_list(NULL), |
|
113 |
db_type(NULL), |
|
114 |
internal_tmp_table(false), |
|
115 |
is_alias(false), |
|
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
116 |
is_fqtn(false), |
117 |
create(false) |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
118 |
{}
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
119 |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
120 |
/**
|
121 |
* List of tables local to a subquery (used by SQL_LIST). Considers
|
|
122 |
* views as leaves (unlike 'next_leaf' below). Created at parse time
|
|
123 |
* in Select_Lex::add_table_to_list() -> table_list.link_in_list().
|
|
124 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
125 |
TableList *next_local; |
1034.1.4
by Brian Aker
Fixed TableList to correctly construct (and removed memset() calls in |
126 |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
127 |
/** link in a global list of all queries tables */
|
1034.1.4
by Brian Aker
Fixed TableList to correctly construct (and removed memset() calls in |
128 |
TableList *next_global; |
129 |
TableList **prev_global; |
|
1874.1.1
by Brian Aker
Encapsulate schema_name it table_list. |
130 |
|
131 |
private: |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
132 |
char *db; |
1874.1.1
by Brian Aker
Encapsulate schema_name it table_list. |
133 |
|
134 |
public: |
|
135 |
const char *getSchemaName() |
|
136 |
{
|
|
137 |
return db; |
|
138 |
}
|
|
139 |
||
140 |
char **getSchemaNamePtr() |
|
141 |
{
|
|
142 |
return &db; |
|
143 |
}
|
|
144 |
||
145 |
void setSchemaName(char *arg) |
|
146 |
{
|
|
147 |
db= arg; |
|
148 |
}
|
|
149 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
150 |
const char *alias; |
1874.1.2
by Brian Aker
Encapsulate table_name from table_list. |
151 |
|
152 |
private: |
|
2151.2.10
by Olaf van der Spek
Const fixes |
153 |
const char *table_name; |
1874.1.2
by Brian Aker
Encapsulate table_name from table_list. |
154 |
|
155 |
public: |
|
156 |
const char *getTableName() |
|
157 |
{
|
|
158 |
return table_name; |
|
159 |
}
|
|
160 |
||
2151.2.10
by Olaf van der Spek
Const fixes |
161 |
void setTableName(const char *arg) |
1874.1.2
by Brian Aker
Encapsulate table_name from table_list. |
162 |
{
|
163 |
table_name= arg; |
|
164 |
}
|
|
165 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
166 |
char *option; ///< Used by cache index |
167 |
Item *on_expr; ///< Used with outer join |
|
168 |
Table *table; ///< opened table |
|
169 |
/**
|
|
170 |
* The structure of ON expression presented in the member above
|
|
171 |
* can be changed during certain optimizations. This member
|
|
172 |
* contains a snapshot of AND-OR structure of the ON expression
|
|
173 |
* made after permanent transformations of the parse tree, and is
|
|
174 |
* used to restore ON clause before every reexecution of a prepared
|
|
175 |
* statement or stored procedure.
|
|
176 |
*/
|
|
177 |
Item *prep_on_expr; |
|
178 |
COND_EQUAL *cond_equal; ///< Used with outer join |
|
179 |
/**
|
|
180 |
* During parsing - left operand of NATURAL/USING join where 'this' is
|
|
181 |
* the right operand. After parsing (this->natural_join == this) iff
|
|
182 |
* 'this' represents a NATURAL or USING join operation. Thus after
|
|
183 |
* parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
|
|
184 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
185 |
TableList *natural_join; |
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
186 |
/**
|
187 |
* True if 'this' represents a nested join that is a NATURAL JOIN.
|
|
188 |
* For one of the operands of 'this', the member 'natural_join' points
|
|
189 |
* to the other operand of 'this'.
|
|
190 |
*/
|
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
191 |
bool is_natural_join; |
1030.1.2
by Brian Aker
More alignment for structures |
192 |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
193 |
/** true if join_columns contains all columns of this table reference. */
|
1030.1.2
by Brian Aker
More alignment for structures |
194 |
bool is_join_columns_complete; |
195 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
196 |
bool straight; ///< optimize with prev table |
197 |
bool force_index; ///< prefer index over table scan |
|
198 |
bool ignore_leaves; ///< preload only non-leaf nodes |
|
199 |
||
1637.1.3
by Brian Aker
This fixes the parser to no longer do the bad syntax around the cross join |
200 |
/*
|
201 |
is the table a cartesian join, assumption is yes unless "solved"
|
|
202 |
*/
|
|
203 |
bool isCartesian() const; |
|
204 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
205 |
/** Field names in a USING clause for JOIN ... USING. */
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
206 |
List<String> *join_using_fields; |
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
207 |
/**
|
208 |
* Explicitly store the result columns of either a NATURAL/USING join or
|
|
209 |
* an operand of such a join.
|
|
210 |
*/
|
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
211 |
List<Natural_join_column> *join_columns; |
212 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
213 |
/**
|
214 |
* List of nodes in a nested join tree, that should be considered as
|
|
215 |
* leaves with respect to name resolution. The leaves are: views,
|
|
216 |
* top-most nodes representing NATURAL/USING joins, subqueries, and
|
|
217 |
* base tables. All of these TableList instances contain a
|
|
218 |
* materialized list of columns. The list is local to a subquery.
|
|
219 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
220 |
TableList *next_name_resolution_table; |
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
221 |
/** Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
222 |
List<Index_hint> *index_hints; |
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
223 |
/**
|
224 |
* select_result for derived table to pass it from table creation to table
|
|
225 |
* filling procedure
|
|
226 |
*/
|
|
227 |
select_union *derived_result; |
|
228 |
Select_Lex_Unit *derived; ///< Select_Lex_Unit of derived table */ |
|
229 |
Select_Lex *schema_select_lex; |
|
230 |
/** link to select_lex where this table was used */
|
|
231 |
Select_Lex *select_lex; |
|
232 |
/**
|
|
233 |
* List of all base tables local to a subquery including all view
|
|
234 |
* tables. Unlike 'next_local', this in this list views are *not*
|
|
235 |
* leaves. Created in setup_tables() -> make_leaves_list().
|
|
236 |
*/
|
|
237 |
TableList *next_leaf; |
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
238 |
thr_lock_type lock_type; |
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
239 |
uint32_t outer_join; ///< Which join type |
240 |
size_t db_length; |
|
241 |
size_t table_name_length; |
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
242 |
|
243 |
void set_underlying_merge(); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
244 |
bool setup_underlying(Session *session); |
1034.1.4
by Brian Aker
Fixed TableList to correctly construct (and removed memset() calls in |
245 |
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
246 |
/**
|
247 |
* If you change placeholder(), please check the condition in
|
|
248 |
* check_transactional_lock() too.
|
|
249 |
*/
|
|
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. |
250 |
bool placeholder(); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
251 |
/**
|
252 |
* Print table as it should be in join list.
|
|
253 |
*
|
|
254 |
* @param str string where table should be printed
|
|
255 |
*/
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
256 |
void print(Session *session, String *str, enum_query_type query_type); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
257 |
/**
|
258 |
* Sets insert_values buffer
|
|
259 |
*
|
|
260 |
* @param[in] memory pool for allocating
|
|
261 |
*
|
|
262 |
* @retval
|
|
263 |
* false - OK
|
|
264 |
* @retval
|
|
265 |
* true - out of memory
|
|
266 |
*/
|
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
267 |
bool set_insert_values(memory::Root *mem_root); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
268 |
/**
|
269 |
* Find underlying base tables (TableList) which represent given
|
|
270 |
* table_to_find (Table)
|
|
271 |
*
|
|
272 |
* @param[in] table to find
|
|
273 |
*
|
|
274 |
* @retval
|
|
275 |
* NULL if table is not found
|
|
276 |
* @retval
|
|
277 |
* Pointer to found table reference
|
|
278 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
279 |
TableList *find_underlying_table(Table *table); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
280 |
/**
|
281 |
* Retrieve the first (left-most) leaf in a nested join tree with
|
|
282 |
* respect to name resolution.
|
|
283 |
*
|
|
284 |
* @details
|
|
285 |
*
|
|
286 |
* Given that 'this' is a nested table reference, recursively walk
|
|
287 |
* down the left-most children of 'this' until we reach a leaf
|
|
288 |
* table reference with respect to name resolution.
|
|
289 |
*
|
|
290 |
* @retval
|
|
291 |
* If 'this' is a nested table reference - the left-most child of
|
|
292 |
* the tree rooted in 'this',
|
|
293 |
* else return 'this'
|
|
294 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
295 |
TableList *first_leaf_for_name_resolution(); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
296 |
/**
|
297 |
* Retrieve the last (right-most) leaf in a nested join tree with
|
|
298 |
* respect to name resolution.
|
|
299 |
*
|
|
300 |
* @details
|
|
301 |
*
|
|
302 |
* Given that 'this' is a nested table reference, recursively walk
|
|
303 |
* down the right-most children of 'this' until we reach a leaf
|
|
304 |
* table reference with respect to name resolution.
|
|
305 |
*
|
|
306 |
* @retval
|
|
307 |
* If 'this' is a nested table reference - the right-most child of
|
|
308 |
* the tree rooted in 'this',
|
|
309 |
* else 'this'
|
|
310 |
*/
|
|
327.2.4
by Brian Aker
Refactoring table.h |
311 |
TableList *last_leaf_for_name_resolution(); |
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
312 |
/**
|
313 |
* Test if this is a leaf with respect to name resolution.
|
|
314 |
*
|
|
315 |
* @details
|
|
316 |
*
|
|
317 |
* A table reference is a leaf with respect to name resolution if
|
|
318 |
* it is either a leaf node in a nested join tree (table, view,
|
|
319 |
* schema table, subquery), or an inner node that represents a
|
|
320 |
* NATURAL/USING join, or a nested join with materialized join
|
|
321 |
* columns.
|
|
322 |
*
|
|
323 |
* @retval
|
|
324 |
* true if a leaf, false otherwise.
|
|
325 |
*/
|
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
326 |
bool is_leaf_for_name_resolution(); |
327.2.4
by Brian Aker
Refactoring table.h |
327 |
inline TableList *top_table() |
1054.1.7
by Brian Aker
Refactor TableList methods. |
328 |
{ return this; } |
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
329 |
|
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
330 |
/**
|
331 |
* Return subselect that contains the FROM list this table is taken from
|
|
332 |
*
|
|
333 |
* @retval
|
|
334 |
* Subselect item for the subquery that contains the FROM list
|
|
335 |
* this table is taken from if there is any
|
|
336 |
* @retval
|
|
337 |
* NULL otherwise
|
|
338 |
*/
|
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
339 |
Item_subselect *containing_subselect(); |
340 |
||
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
341 |
/**
|
342 |
* Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
|
|
343 |
* st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
|
|
344 |
* st_table::force_index and st_table::covering_keys.
|
|
1188.1.2
by Jay Pipes
Style and doxygen cleanup ONLY. Moves method documentation from source into header files. Removes TAB characters and cleans up indentation. |
345 |
*
|
346 |
* @param the Table to operate on.
|
|
347 |
*
|
|
348 |
* @details
|
|
349 |
*
|
|
350 |
* The parser collects the index hints for each table in a "tagged list"
|
|
351 |
* (TableList::index_hints). Using the information in this tagged list
|
|
352 |
* this function sets the members Table::keys_in_use_for_query,
|
|
353 |
* Table::keys_in_use_for_group_by, Table::keys_in_use_for_order_by,
|
|
354 |
* Table::force_index and Table::covering_keys.
|
|
355 |
*
|
|
356 |
* Current implementation of the runtime does not allow mixing FORCE INDEX
|
|
357 |
* and USE INDEX, so this is checked here. Then the FORCE INDEX list
|
|
358 |
* (if non-empty) is appended to the USE INDEX list and a flag is set.
|
|
359 |
*
|
|
360 |
* Multiple hints of the same kind are processed so that each clause
|
|
361 |
* is applied to what is computed in the previous clause.
|
|
362 |
*
|
|
363 |
* For example:
|
|
364 |
* USE INDEX (i1) USE INDEX (i2)
|
|
365 |
* is equivalent to
|
|
366 |
* USE INDEX (i1,i2)
|
|
367 |
* and means "consider only i1 and i2".
|
|
368 |
*
|
|
369 |
* Similarly
|
|
370 |
* USE INDEX () USE INDEX (i1)
|
|
371 |
* is equivalent to
|
|
372 |
* USE INDEX (i1)
|
|
373 |
* and means "consider only the index i1"
|
|
374 |
*
|
|
375 |
* It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is
|
|
376 |
* not an error.
|
|
377 |
*
|
|
378 |
* Different kind of hints (USE/FORCE/IGNORE) are processed in the following
|
|
379 |
* order:
|
|
380 |
* 1. All indexes in USE (or FORCE) INDEX are added to the mask.
|
|
381 |
* 2. All IGNORE INDEX
|
|
382 |
* e.g. "USE INDEX i1, IGNORE INDEX i1, USE INDEX i1" will not use i1 at all
|
|
383 |
* as if we had "USE INDEX i1, USE INDEX i1, IGNORE INDEX i1".
|
|
384 |
* As an optimization if there is a covering index, and we have
|
|
385 |
* IGNORE INDEX FOR GROUP/order_st, and this index is used for the JOIN part,
|
|
386 |
* then we have to ignore the IGNORE INDEX FROM GROUP/order_st.
|
|
387 |
*
|
|
388 |
* @retval
|
|
389 |
* false no errors found
|
|
390 |
* @retval
|
|
391 |
* true found and reported an error.
|
|
1188.1.1
by Jay Pipes
Style-only cleanups and doxygenation of TableList class and its members. |
392 |
*/
|
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
393 |
bool process_index_hints(Table *table); |
1637.1.3
by Brian Aker
This fixes the parser to no longer do the bad syntax around the cross join |
394 |
|
395 |
friend std::ostream& operator<<(std::ostream& output, const TableList &list) |
|
396 |
{
|
|
397 |
output << "TableList:("; |
|
398 |
output << list.db; |
|
399 |
output << ", "; |
|
400 |
output << list.table_name; |
|
401 |
output << ", "; |
|
402 |
output << list.alias; |
|
403 |
output << ", "; |
|
404 |
output << "is_natural_join:" << list.is_natural_join; |
|
405 |
output << ", "; |
|
406 |
output << "is_join_columns_complete:" << list.is_join_columns_complete; |
|
407 |
output << ", "; |
|
408 |
output << "straight:" << list.straight; |
|
409 |
output << ", "; |
|
410 |
output << "force_index" << list.force_index; |
|
411 |
output << ", "; |
|
412 |
output << "ignore_leaves:" << list.ignore_leaves; |
|
413 |
output << ", "; |
|
414 |
output << "create:" << list.create; |
|
415 |
output << ", "; |
|
416 |
output << "outer_join:" << list.outer_join; |
|
417 |
output << ", "; |
|
418 |
output << "nested_join:" << list.nested_join; |
|
419 |
output << ")"; |
|
420 |
||
421 |
return output; // for multiple << operators. |
|
422 |
}
|
|
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
423 |
|
424 |
void setIsAlias(bool in_is_alias) |
|
425 |
{
|
|
426 |
is_alias= in_is_alias; |
|
427 |
}
|
|
428 |
||
429 |
void setIsFqtn(bool in_is_fqtn) |
|
430 |
{
|
|
431 |
is_fqtn= in_is_fqtn; |
|
432 |
}
|
|
433 |
||
434 |
void setCreate(bool in_create) |
|
435 |
{
|
|
436 |
create= in_create; |
|
437 |
}
|
|
438 |
||
439 |
void setInternalTmpTable(bool in_internal_tmp_table) |
|
440 |
{
|
|
441 |
internal_tmp_table= in_internal_tmp_table; |
|
442 |
}
|
|
443 |
||
444 |
void setDbType(plugin::StorageEngine *in_db_type) |
|
445 |
{
|
|
446 |
db_type= in_db_type; |
|
447 |
}
|
|
448 |
||
449 |
void setJoinList(List<TableList> *in_join_list) |
|
450 |
{
|
|
451 |
join_list= in_join_list; |
|
452 |
}
|
|
453 |
||
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
454 |
void setEmbedding(TableList *in_embedding) |
455 |
{
|
|
456 |
embedding= in_embedding; |
|
457 |
}
|
|
458 |
||
2141.3.3
by vjsamuel1990 at gmail
Merge change nested_join_st to NestedJoin |
459 |
void setNestedJoin(NestedJoin *in_nested_join) |
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
460 |
{
|
461 |
nested_join= in_nested_join; |
|
462 |
}
|
|
463 |
||
464 |
void setDepTables(table_map in_dep_tables) |
|
465 |
{
|
|
466 |
dep_tables= in_dep_tables; |
|
467 |
}
|
|
468 |
||
469 |
void setOnExprDepTables(table_map in_on_expr_dep_tables) |
|
470 |
{
|
|
471 |
on_expr_dep_tables= in_on_expr_dep_tables; |
|
472 |
}
|
|
473 |
||
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
474 |
bool getIsAlias() const |
475 |
{
|
|
476 |
return is_alias; |
|
477 |
}
|
|
478 |
||
479 |
bool getIsFqtn() const |
|
480 |
{
|
|
481 |
return is_fqtn; |
|
482 |
}
|
|
483 |
||
1637.2.9
by Vijay Samuel
Merge Brian's request for isCreate() instead of getCreate(). |
484 |
bool isCreate() const |
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
485 |
{
|
486 |
return create; |
|
487 |
}
|
|
488 |
||
489 |
bool getInternalTmpTable() const |
|
490 |
{
|
|
491 |
return internal_tmp_table; |
|
492 |
}
|
|
493 |
||
494 |
plugin::StorageEngine *getDbType() const |
|
495 |
{
|
|
496 |
return db_type; |
|
497 |
}
|
|
498 |
||
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
499 |
TableList *getEmbedding() const |
500 |
{
|
|
501 |
return embedding; |
|
502 |
}
|
|
503 |
||
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
504 |
List<TableList> *getJoinList() const |
505 |
{
|
|
506 |
return join_list; |
|
507 |
}
|
|
508 |
||
2141.3.3
by vjsamuel1990 at gmail
Merge change nested_join_st to NestedJoin |
509 |
NestedJoin *getNestedJoin() const |
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
510 |
{
|
511 |
return nested_join; |
|
512 |
}
|
|
513 |
||
514 |
table_map getDepTables() const |
|
515 |
{
|
|
516 |
return dep_tables; |
|
517 |
}
|
|
518 |
||
519 |
table_map getOnExprDepTables() const |
|
520 |
{
|
|
521 |
return on_expr_dep_tables; |
|
522 |
}
|
|
523 |
||
1910.2.4
by Brian Aker
Push some functions behind classes. |
524 |
void unlock_table_name(); |
525 |
void unlock_table_names(TableList *last_table= NULL); |
|
526 |
||
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
527 |
private: |
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
528 |
table_map dep_tables; ///< tables the table depends on |
529 |
table_map on_expr_dep_tables; ///< tables on expression depends on |
|
2141.3.3
by vjsamuel1990 at gmail
Merge change nested_join_st to NestedJoin |
530 |
NestedJoin *nested_join; ///< if the element is a nested join |
1637.2.7
by Vijay Samuel
Merge encapsulate TableList-2. |
531 |
TableList *embedding; ///< nested join containing the table |
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
532 |
List<TableList> *join_list; ///< join list the table belongs to |
533 |
plugin::StorageEngine *db_type; ///< table_type for handler |
|
534 |
bool internal_tmp_table; |
|
2134.1.1
by Brian Aker
Remove dead bit from tablelist class. |
535 |
|
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
536 |
/** true if an alias for this table was specified in the SQL. */
|
537 |
bool is_alias; |
|
538 |
||
539 |
/**
|
|
540 |
* true if the table is referred to in the statement using a fully
|
|
541 |
* qualified name (<db_name>.<table_name>).
|
|
542 |
*/
|
|
543 |
bool is_fqtn; |
|
2134.1.1
by Brian Aker
Remove dead bit from tablelist class. |
544 |
|
1641.1.1
by Zimin
move the comment of 'create' in TableList as well |
545 |
/**
|
546 |
* This TableList object corresponds to the table to be created
|
|
547 |
* so it is possible that it does not exist (used in CREATE TABLE
|
|
548 |
* ... SELECT implementation).
|
|
549 |
*/
|
|
1637.2.6
by Vijay Samuel
Merge encapsulate TableList-1. |
550 |
bool create; |
551 |
||
327.1.5
by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h |
552 |
};
|
520.6.7
by Monty Taylor
Moved a bunch of crap out of common_includes. |
553 |
|
554 |
void close_thread_tables(Session *session); |
|
555 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
556 |
} /* namespace drizzled */ |
557 |
||
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. |
558 |
#endif /* DRIZZLED_TABLE_LIST_H */ |