17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SQL_LEX_H
21
#define DRIZZLED_SQL_LEX_H
24
23
@defgroup Semantic_Analysis Semantic Analysis
26
25
#include <drizzled/message/table.pb.h>
28
#include "drizzled/plugin/function.h"
29
#include "drizzled/name_resolution_context.h"
30
#include "drizzled/item/subselect.h"
31
#include "drizzled/table_list.h"
32
#include "drizzled/function/math/real.h"
33
#include "drizzled/alter_drop.h"
34
#include "drizzled/alter_column.h"
35
#include "drizzled/alter_info.h"
36
#include "drizzled/key_part_spec.h"
37
#include "drizzled/index_hint.h"
38
#include "drizzled/statement.h"
39
#include "drizzled/optimizer/explain_plan.h"
26
#include <drizzled/name_resolution_context.h>
27
#include <drizzled/table_list.h>
28
#include <drizzled/function/math/real.h>
29
#include <drizzled/key_part_spec.h>
30
#include <drizzled/index_hint.h>
31
#include <drizzled/optimizer/explain_plan.h>
38
namespace plugin { class Function; }
39
namespace statement { class Statement; }
47
46
class st_lex_symbol;
48
47
class select_result_interceptor;
72
71
# if defined(DRIZZLE_LEX)
73
72
# include <drizzled/foreign_key.h>
74
73
# include <drizzled/lex_symbol.h>
74
# include <drizzled/comp_creator.h>
75
75
# include <drizzled/sql_yacc.h>
76
76
# define LEX_YYSTYPE YYSTYPE *
383
383
inline void unclean() { cleaned= 0; }
384
384
void reinit_exec_mechanism();
386
void print(String *str, enum_query_type query_type);
386
void print(String *str);
388
388
bool add_fake_select_lex(Session *session);
389
389
void init_prepare_fake_select_lex(Session *session);
475
474
Item::cond_result having_value;
476
475
/* point on lex in which it was created, used in view subquery detection */
479
478
/* FROM clause - points to the beginning of the TableList::next_local list. */
480
479
SQL_LIST table_list;
481
480
SQL_LIST group_list; /* GROUP BY clause. */
493
492
by TableList::next_leaf, so leaf_tables points to the left-most leaf.
495
494
TableList *leaf_tables;
496
enum drizzled::optimizer::select_type type; /* type of select for EXPLAIN */
495
drizzled::optimizer::select_type type; /* type of select for EXPLAIN */
498
497
SQL_LIST order_list; /* ORDER clause */
499
498
SQL_LIST *gorder_list;
654
653
bool setup_ref_array(Session *session, uint32_t order_group_num);
655
void print(Session *session, String *str, enum_query_type query_type);
656
static void print_order(String *str,
658
enum_query_type query_type);
659
void print_limit(Session *session, String *str, enum_query_type query_type);
654
void print(Session *session, String *str);
655
static void print_order(String *str, Order *order);
657
void print_limit(Session *session, String *str);
660
658
void fix_prepare_information(Session *session, Item **conds, Item **having_conds);
662
660
Destroy the used execution plan (JOIN) of this subtree (this
670
668
void cleanup_all_joins(bool full);
672
void set_index_hint_type(enum index_hint_type type, index_clause_map clause);
670
void set_index_hint_type(index_hint_type type, index_clause_map clause);
675
673
Add a index hint to the tagged list of hints. The type and clause of the
693
691
/* current index hint kind. used in filling up index_hints */
694
enum index_hint_type current_index_hint_type;
692
index_hint_type current_index_hint_type;
695
693
index_clause_map current_index_hint_clause;
696
694
/* a list of USE/FORCE/IGNORE INDEX */
697
695
List<Index_hint> *index_hints;
817
815
/* list of all Select_Lex */
818
816
Select_Lex *all_selects_list;
820
/* This is the "scale" for DECIMAL (S,P) notation */
818
/* This is the "scale" for DECIMAL (S,P) notation */
822
820
/* This is the decimal precision in DECIMAL(S,P) notation */
826
* This is used kind of like the "ident" member variable below, as
824
* This is used kind of like the "ident" member variable below, as
827
825
* a place to store certain names of identifiers. Unfortunately, it
828
826
* is used differently depending on the Command (SELECT on a derived
829
827
* table vs CREATE)