diff options
author | Gleb Shchepa <gleb.shchepa@oracle.com> | 2014-06-23 19:59:15 +0400 |
---|---|---|
committer | Gleb Shchepa <gleb.shchepa@oracle.com> | 2014-06-23 19:59:15 +0400 |
commit | 7141ae856164c19b6c6faefb4ea7e21a98b0c92a (patch) | |
tree | 588f77c9e40c5133d2b6c67d7c19be761b99c760 /sql/sql_yacc.yy | |
parent | 2e26e9057cb39e85699d41642802faa4e6995471 (diff) | |
download | mariadb-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_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3af964db731..bd5d4dc5604 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -22,13 +22,9 @@ */ %{ -/* thd is passed as an argument to yyparse(), and subsequently to yylex(). -** The type will be void*, so it must be cast to (THD*) when used. -** Use the YYTHD macro for this. +/* +Note: YYTHD is passed as an argument to yyparse(), and subsequently to yylex(). */ -#define YYPARSE_PARAM yythd -#define YYLEX_PARAM yythd -#define YYTHD ((THD *)yythd) #define YYLIP (& YYTHD->m_parser_state->m_lip) #define YYPS (& YYTHD->m_parser_state->m_yacc) @@ -76,7 +72,7 @@ int yylex(void *yylval, void *yythd); ulong val= *(F); \ if (my_yyoverflow((B), (D), &val)) \ { \ - yyerror((char*) (A)); \ + yyerror(YYTHD, (char*) (A)); \ return 2; \ } \ else \ @@ -174,10 +170,8 @@ void my_parse_error(const char *s) to abort from the parser. */ -void MYSQLerror(const char *s) +void MYSQLerror(THD *thd, const char *s) { - THD *thd= current_thd; - /* Restore the original LEX if it was replaced when parsing a stored procedure. We must ensure that a parsing error @@ -787,7 +781,9 @@ static bool add_create_index (LEX *lex, Key::Keytype type, bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %} -%pure_parser /* We have threads */ +%parse-param { class THD *YYTHD } +%lex-param { class THD *YYTHD } +%pure-parser /* We have threads */ /* Currently there are 168 shift/reduce conflicts. We should not introduce new conflicts any more. |