diff options
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b9f84ac542d..8aeb2e6c516 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. + Copyright (c) 2009, 2014, Monty Program Ab. 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 @@ -30,7 +30,7 @@ #include "sp.h" #include "sql_select.h" -static int lex_one_token(void *arg, THD *thd); +static int lex_one_token(YYSTYPE *yylval, THD *thd); /* We are using pointer to this variable for distinguishing between assignment @@ -951,15 +951,17 @@ bool consume_comment(Lex_input_stream *lip, int remaining_recursions_permitted) /* MYSQLlex remember the following states from the following MYSQLlex() + @param yylval [out] semantic value of the token being parsed (yylval) + @param thd THD + - MY_LEX_EOQ Found end of query - MY_LEX_OPERATOR_OR_IDENT Last state was an ident, text or number (which can't be followed by a signed number) */ -int MYSQLlex(void *arg, THD *thd) +int MYSQLlex(YYSTYPE *yylval, THD *thd) { Lex_input_stream *lip= & thd->m_parser_state->m_lip; - YYSTYPE *yylval=(YYSTYPE*) arg; int token; if (lip->lookahead_token >= 0) @@ -975,7 +977,7 @@ int MYSQLlex(void *arg, THD *thd) return token; } - token= lex_one_token(arg, thd); + token= lex_one_token(yylval, thd); switch(token) { case WITH: @@ -986,7 +988,7 @@ int MYSQLlex(void *arg, THD *thd) to transform the grammar into a LALR(1) grammar, which sql_yacc.yy can process. */ - token= lex_one_token(arg, thd); + token= lex_one_token(yylval, thd); switch(token) { case CUBE_SYM: return WITH_CUBE_SYM; @@ -1009,7 +1011,7 @@ int MYSQLlex(void *arg, THD *thd) return token; } -int lex_one_token(void *arg, THD *thd) +static int lex_one_token(YYSTYPE *yylval, THD *thd) { reg1 uchar c; bool comment_closed; @@ -1018,7 +1020,6 @@ int lex_one_token(void *arg, THD *thd) enum my_lex_states state; Lex_input_stream *lip= & thd->m_parser_state->m_lip; LEX *lex= thd->lex; - YYSTYPE *yylval=(YYSTYPE*) arg; CHARSET_INFO *const cs= thd->charset(); const uchar *const state_map= cs->state_map; const uchar *const ident_map= cs->ident_map; |