266
Base class for st_select_lex (SELECT_LEX) &
267
st_select_lex_unit (SELECT_LEX_UNIT)
266
Base class for Select_Lex (Select_Lex) &
267
Select_Lex_unit (Select_Lex_UNIT)
271
class st_select_lex_unit;
272
class st_select_lex_node {
271
class Select_Lex_unit;
272
class Select_Lex_node {
274
st_select_lex_node *next, **prev, /* neighbor list */
274
Select_Lex_node *next, **prev, /* neighbor list */
275
275
*master, *slave, /* vertical links */
276
*link_next, **link_prev; /* list of whole SELECT_LEX */
276
*link_next, **link_prev; /* list of whole Select_Lex */
279
279
uint64_t options;
301
301
{ TRASH(ptr, size); }
302
302
static void operator delete(void *, MEM_ROOT *)
304
st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {}
305
virtual ~st_select_lex_node() {}
306
inline st_select_lex_node* get_master() { return master; }
304
Select_Lex_node(): linkage(UNSPECIFIED_TYPE) {}
305
virtual ~Select_Lex_node() {}
306
inline Select_Lex_node* get_master() { return master; }
307
307
virtual void init_query();
308
308
virtual void init_select();
309
void include_down(st_select_lex_node *upper);
310
void include_neighbour(st_select_lex_node *before);
311
void include_standalone(st_select_lex_node *sel, st_select_lex_node **ref);
312
void include_global(st_select_lex_node **plink);
309
void include_down(Select_Lex_node *upper);
310
void include_neighbour(Select_Lex_node *before);
311
void include_standalone(Select_Lex_node *sel, Select_Lex_node **ref);
312
void include_global(Select_Lex_node **plink);
315
virtual st_select_lex_unit* master_unit()= 0;
316
virtual st_select_lex* outer_select()= 0;
317
virtual st_select_lex* return_after_parsing()= 0;
315
virtual Select_Lex_unit* master_unit()= 0;
316
virtual Select_Lex* outer_select()= 0;
317
virtual Select_Lex* return_after_parsing()= 0;
319
319
virtual bool set_braces(bool value);
320
320
virtual bool inc_in_sum_expr();
331
331
virtual void set_lock_for_tables(thr_lock_type)
334
friend class st_select_lex_unit;
334
friend class Select_Lex_unit;
335
335
friend bool mysql_new_select(LEX *lex, bool move_down);
337
337
void fast_exclude();
339
typedef class st_select_lex_node SELECT_LEX_NODE;
339
typedef class Select_Lex_node Select_Lex_NODE;
342
SELECT_LEX_UNIT - unit of selects (UNION, INTERSECT, ...) group
342
Select_Lex_UNIT - unit of selects (UNION, INTERSECT, ...) group
346
346
class select_result;
348
348
class select_union;
349
class st_select_lex_unit: public st_select_lex_node {
349
class Select_Lex_unit: public Select_Lex_node {
351
351
TableList result_table_list;
352
352
select_union *union_result;
380
380
Pointer to 'last' select or pointer to unit where stored
381
381
global parameters for union
383
st_select_lex *global_parameters;
383
Select_Lex *global_parameters;
384
384
//node on wich we should return current_select pointer after parsing subquery
385
st_select_lex *return_to;
385
Select_Lex *return_to;
386
386
/* LIMIT clause runtime counters */
387
387
ha_rows select_limit_cnt, offset_limit_cnt;
388
388
/* not NULL if unit used in subselect, point to subselect item */
390
390
/* thread handler */
391
391
Session *session;
393
SELECT_LEX for hidden SELECT in onion which process global
393
Select_Lex for hidden SELECT in onion which process global
394
394
ORDER BY and LIMIT
396
st_select_lex *fake_select_lex;
396
Select_Lex *fake_select_lex;
398
st_select_lex *union_distinct; /* pointer to the last UNION DISTINCT */
398
Select_Lex *union_distinct; /* pointer to the last UNION DISTINCT */
399
399
bool describe; /* union exec() called for EXPLAIN */
401
401
void init_query();
402
st_select_lex_unit* master_unit();
403
st_select_lex* outer_select();
404
st_select_lex* first_select()
406
return reinterpret_cast<st_select_lex*>(slave);
408
st_select_lex_unit* next_unit()
410
return reinterpret_cast<st_select_lex_unit*>(next);
412
st_select_lex* return_after_parsing() { return return_to; }
402
Select_Lex_unit* master_unit();
403
Select_Lex* outer_select();
404
Select_Lex* first_select()
406
return reinterpret_cast<Select_Lex*>(slave);
408
Select_Lex_unit* next_unit()
410
return reinterpret_cast<Select_Lex_unit*>(next);
412
Select_Lex* return_after_parsing() { return return_to; }
413
413
void exclude_level();
414
414
void exclude_tree();
426
426
void init_prepare_fake_select_lex(Session *session);
427
427
bool change_result(select_result_interceptor *result,
428
428
select_result_interceptor *old_result);
429
void set_limit(st_select_lex *values);
429
void set_limit(Select_Lex *values);
430
430
void set_session(Session *session_arg) { session= session_arg; }
431
431
inline bool is_union ();
436
436
List<Item> *get_unit_column_types();
439
typedef class st_select_lex_unit SELECT_LEX_UNIT;
439
typedef class Select_Lex_unit Select_Lex_UNIT;
442
SELECT_LEX - store information of parsed SELECT statment
442
Select_Lex - store information of parsed SELECT statment
444
class st_select_lex: public st_select_lex_node
444
class Select_Lex: public Select_Lex_node
447
447
Name_resolution_context context;
537
537
This is a copy of the original JOIN USING list that comes from
538
538
the parser. The parser :
539
539
1. Sets the natural_join of the second TableList in the join
540
and the st_select_lex::prev_join_using.
540
and the Select_Lex::prev_join_using.
541
541
2. Makes a parent TableList and sets its is_natural_join/
542
542
join_using_fields members.
543
543
3. Uses the wrapper TableList as a table in the upper level.
559
559
uint8_t full_group_by_flag;
560
560
void init_query();
561
561
void init_select();
562
st_select_lex_unit* master_unit();
563
st_select_lex_unit* first_inner_unit()
565
return (st_select_lex_unit*) slave;
567
st_select_lex* outer_select();
568
st_select_lex* next_select() { return (st_select_lex*) next; }
569
st_select_lex* next_select_in_list()
571
return (st_select_lex*) link_next;
573
st_select_lex_node** next_select_in_list_addr()
562
Select_Lex_unit* master_unit();
563
Select_Lex_unit* first_inner_unit()
565
return (Select_Lex_unit*) slave;
567
Select_Lex* outer_select();
568
Select_Lex* next_select() { return (Select_Lex*) next; }
569
Select_Lex* next_select_in_list()
571
return (Select_Lex*) link_next;
573
Select_Lex_node** next_select_in_list_addr()
575
575
return &link_next;
577
st_select_lex* return_after_parsing()
577
Select_Lex* return_after_parsing()
579
579
return master_unit()->return_after_parsing();
582
void mark_as_dependent(st_select_lex *last);
582
void mark_as_dependent(Select_Lex *last);
584
584
bool set_braces(bool value);
585
585
bool inc_in_sum_expr();
613
613
This method created for reiniting LEX in mysql_admin_table() and can be
614
used only if you are going remove all SELECT_LEX & units except belonger
614
used only if you are going remove all Select_Lex & units except belonger
615
615
to LEX (LEX::unit & LEX::select, for other purposes there are
616
SELECT_LEX_UNIT::exclude_level & SELECT_LEX_UNIT::exclude_tree
616
Select_Lex_UNIT::exclude_level & Select_Lex_UNIT::exclude_tree
618
618
void cut_subtree() { slave= 0; }
619
619
bool test_limit();
621
621
friend void lex_start(Session *session);
622
st_select_lex() : n_sum_items(0), n_child_sum_items(0) {}
622
Select_Lex() : n_sum_items(0), n_child_sum_items(0) {}
623
623
void make_empty_select()
634
634
void fix_prepare_information(Session *session, Item **conds, Item **having_conds);
636
636
Destroy the used execution plan (JOIN) of this subtree (this
637
SELECT_LEX and all nested SELECT_LEXes and SELECT_LEX_UNITs).
637
Select_Lex and all nested Select_Lexes and Select_Lex_UNITs).
670
670
/* a list of USE/FORCE/IGNORE INDEX */
671
671
List<Index_hint> *index_hints;
673
typedef class st_select_lex SELECT_LEX;
673
typedef class Select_Lex Select_Lex;
675
inline bool st_select_lex_unit::is_union ()
675
inline bool Select_Lex_unit::is_union ()
677
677
return first_select()->next_select() &&
678
678
first_select()->next_select()->linkage == UNION_TYPE;
1246
1246
class LEX : public Query_tables_list
1249
SELECT_LEX_UNIT unit; /* most upper unit */
1250
SELECT_LEX select_lex; /* first SELECT_LEX */
1251
/* current SELECT_LEX in parsing */
1252
SELECT_LEX *current_select;
1253
/* list of all SELECT_LEX */
1254
SELECT_LEX *all_selects_list;
1249
Select_Lex_UNIT unit; /* most upper unit */
1250
Select_Lex select_lex; /* first Select_Lex */
1251
/* current Select_Lex in parsing */
1252
Select_Lex *current_select;
1253
/* list of all Select_Lex */
1254
Select_Lex *all_selects_list;
1256
1256
char *length,*dec,*change;
1257
1257
LEX_STRING name;