summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index da0b2db892a..dcbbb98fcba 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2014, Monty Program Ab.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@ class sys_var;
class Item_func_match;
class File_parser;
class Key_part_spec;
+struct sql_digest_state;
#define ALLOC_ROOT_SET 1024
@@ -2108,6 +2109,11 @@ public:
LEX_YYSTYPE lookahead_yylval;
bool get_text(LEX_STRING *to, int pre_skip, int post_skip);
+
+ void add_digest_token(uint token, LEX_YYSTYPE yylval);
+
+ void reduce_digest_token(uint token_left, uint token_right);
+
private:
/** Pointer to the current position in the raw input stream. */
char *m_ptr;
@@ -2227,7 +2233,7 @@ public:
/**
Current statement digest instrumentation.
*/
- PSI_digest_locker* m_digest_psi;
+ sql_digest_state* m_digest;
};
/**
@@ -2839,6 +2845,8 @@ public:
return FALSE;
}
+ bool save_prep_leaf_tables();
+
int print_explain(select_result_sink *output, uint8 explain_flags,
bool is_analyze, bool *printed_anything);
void restore_set_statement_var();
@@ -3039,6 +3047,18 @@ public:
};
/**
+ Input parameters to the parser.
+*/
+struct Parser_input
+{
+ bool m_compute_digest;
+
+ Parser_input()
+ : m_compute_digest(false)
+ {}
+};
+
+/**
Internal state of the parser.
The complete state consist of:
- state data used during lexical parsing,
@@ -3065,9 +3085,15 @@ public:
~Parser_state()
{}
+ Parser_input m_input;
Lex_input_stream m_lip;
Yacc_state m_yacc;
+ /**
+ Current performance digest instrumentation.
+ */
+ PSI_digest_locker* m_digest_psi;
+
void reset(char *found_semicolon, unsigned int length)
{
m_lip.reset(found_semicolon, length);
@@ -3075,6 +3101,11 @@ public:
}
};
+extern sql_digest_state *
+digest_add_token(sql_digest_state *state, uint token, LEX_YYSTYPE yylval);
+
+extern sql_digest_state *
+digest_reduce_token(sql_digest_state *state, uint token_left, uint token_right);
struct st_lex_local: public LEX, public Sql_alloc
{