summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2008-12-17 15:01:34 -0500
committerChad MILLER <chad@mysql.com>2008-12-17 15:01:34 -0500
commit1c73da70cea05fa6d7c73cda83d38e1ae6a101df (patch)
tree14bfefa872195990d45ab8f3ee850730cd31ed1b /sql/sql_lex.h
parentca7f3f2ae08e30cd6c68cb7af60d4528759f8bbd (diff)
parent3742489c3797b14ac3c4453ef4058b5a87a62442 (diff)
downloadmariadb-git-1c73da70cea05fa6d7c73cda83d38e1ae6a101df.tar.gz
Merged from 5.0 (enterprise).
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h59
1 files changed, 56 insertions, 3 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 6878e2a4694..d91e3907fb3 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -336,11 +336,11 @@ public:
bool no_table_names_allowed; /* used for global order by */
bool no_error; /* suppress error message (convert it to warnings) */
- static void *operator new(size_t size)
+ static void *operator new(size_t size) throw ()
{
return (void*) sql_alloc((uint) size);
}
- static void *operator new(size_t size, MEM_ROOT *mem_root)
+ static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
@@ -591,6 +591,7 @@ public:
case of an error during prepare the PS is not created.
*/
bool first_execution;
+ bool first_natural_join_processing;
bool first_cond_optimization;
/* do not wrap view fields with Item_ref */
bool no_wrap_view_item;
@@ -1009,7 +1010,6 @@ typedef struct st_lex : public Query_tables_list
LEX_STRING comment, ident;
LEX_USER *grant_user;
XID *xid;
- gptr yacc_yyss,yacc_yyvs;
THD *thd;
CHARSET_INFO *charset, *underscore_charset;
bool text_string_is_7bit;
@@ -1298,6 +1298,59 @@ typedef struct st_lex : public Query_tables_list
}
} LEX;
+
+/**
+ The internal state of the syntax parser.
+ This object is only available during parsing,
+ and is private to the syntax parser implementation (sql_yacc.yy).
+*/
+class Yacc_state
+{
+public:
+ Yacc_state()
+ : yacc_yyss(NULL), yacc_yyvs(NULL)
+ {}
+
+ ~Yacc_state();
+
+ /**
+ Bison internal state stack, yyss, when dynamically allocated using
+ my_yyoverflow().
+ */
+ gptr yacc_yyss;
+
+ /**
+ Bison internal semantic value stack, yyvs, when dynamically allocated using
+ my_yyoverflow().
+ */
+ gptr yacc_yyvs;
+
+ /*
+ TODO: move more attributes from the LEX structure here.
+ */
+};
+
+/**
+ Internal state of the parser.
+ The complete state consist of:
+ - state data used during lexical parsing,
+ - state data used during syntactic parsing.
+*/
+class Parser_state
+{
+public:
+ Parser_state(THD *thd, const char* buff, unsigned int length)
+ : m_lip(thd, buff, length), m_yacc()
+ {}
+
+ ~Parser_state()
+ {}
+
+ Lex_input_stream m_lip;
+ Yacc_state m_yacc;
+};
+
+
struct st_lex_local: public st_lex
{
static void *operator new(size_t size) throw()