summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gleb.shchepa@oracle.com>2014-06-23 19:59:15 +0400
committerGleb Shchepa <gleb.shchepa@oracle.com>2014-06-23 19:59:15 +0400
commit7141ae856164c19b6c6faefb4ea7e21a98b0c92a (patch)
tree588f77c9e40c5133d2b6c67d7c19be761b99c760 /sql/sql_lex.cc
parent2e26e9057cb39e85699d41642802faa4e6995471 (diff)
downloadmariadb-git-7141ae856164c19b6c6faefb4ea7e21a98b0c92a.tar.gz
Bug #18978946: BACKPORT TO 5.6: BUGFIX FOR 18017820 "BISON 3 BREAKS MYSQL BUILD"
Backport of the fix: : Bug 18017820: BISON 3 BREAKS MYSQL BUILD : ======================================== : : The source of the reported problem is a removal of a few deprecated : things from Bison 3.x: : * YYPARSE_PARAM macro (use the %parse-param bison directive instead), : * YYLEX_PARAM macro (use %lex-param instead), : : The fix removes obsolete macro calls and introduces use of : %parse-param and %lex-param directives.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 9113f31c76c..17446778034 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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
@@ -29,7 +29,7 @@
#include "sp.h"
#include "sp_head.h"
-static int lex_one_token(void *arg, void *yythd);
+static int lex_one_token(YYSTYPE *yylval, THD *thd);
/*
We are using pointer to this variable for distinguishing between assignment
@@ -864,16 +864,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, void *yythd)
+int MYSQLlex(YYSTYPE *yylval, THD *thd)
{
- THD *thd= (THD *)yythd;
Lex_input_stream *lip= & thd->m_parser_state->m_lip;
- YYSTYPE *yylval=(YYSTYPE*) arg;
int token;
if (lip->lookahead_token >= 0)
@@ -889,7 +890,7 @@ int MYSQLlex(void *arg, void *yythd)
return token;
}
- token= lex_one_token(arg, yythd);
+ token= lex_one_token(yylval, thd);
switch(token) {
case WITH:
@@ -900,7 +901,7 @@ int MYSQLlex(void *arg, void *yythd)
to transform the grammar into a LALR(1) grammar,
which sql_yacc.yy can process.
*/
- token= lex_one_token(arg, yythd);
+ token= lex_one_token(yylval, thd);
switch(token) {
case CUBE_SYM:
return WITH_CUBE_SYM;
@@ -923,17 +924,15 @@ int MYSQLlex(void *arg, void *yythd)
return token;
}
-int lex_one_token(void *arg, void *yythd)
+static int lex_one_token(YYSTYPE *yylval, THD *thd)
{
reg1 uchar c= 0;
bool comment_closed;
int tokval, result_state;
uint length;
enum my_lex_states state;
- THD *thd= (THD *)yythd;
Lex_input_stream *lip= & thd->m_parser_state->m_lip;
LEX *lex= thd->lex;
- YYSTYPE *yylval=(YYSTYPE*) arg;
CHARSET_INFO *cs= thd->charset();
uchar *state_map= cs->state_map;
uchar *ident_map= cs->ident_map;