diff options
author | pem@mysql.com <> | 2002-11-30 16:43:53 +0100 |
---|---|---|
committer | pem@mysql.com <> | 2002-11-30 16:43:53 +0100 |
commit | 6a8e2a9cbc91ff7e9eb9958a0c5e758685f6c3b8 (patch) | |
tree | 3c9ab9f20773e2fd124295435b89785e322609af /sql | |
parent | 87fbeb4098fed0f2e100e00bdd88667d1f738190 (diff) | |
download | mariadb-git-6a8e2a9cbc91ff7e9eb9958a0c5e758685f6c3b8.tar.gz |
Pass thd as an argument to yylex().
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_lex.cc | 4 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index be0430d4afe..9b69234c1da 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -442,13 +442,13 @@ inline static uint int_token(const char *str,uint length) // STATE_OPERATOR_OR_IDENT ; last state was an ident, text or number // (which can't be followed by a signed number) -int yylex(void *arg) +int yylex(void *arg, void *yythd) { reg1 uchar c; int tokval; uint length; enum lex_states state,prev_state; - LEX *lex=current_lex; + LEX *lex= &(((THD *)yythd)->lex); YYSTYPE *yylval=(YYSTYPE*) arg; lex->yylval=yylval; // The global state diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 13836902736..edac7c87466 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -17,10 +17,12 @@ /* sql_yacc.yy */ %{ -/* Pass thd as an arg to yyparse(). The type will be void*, so it -** must be cast to (THD*) when used. Use the YYTHD macro for this. +/* thd is passed as an arg 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. */ #define YYPARSE_PARAM yythd +#define YYLEX_PARAM yythd #define YYTHD ((THD *)yythd) #define MYSQL_YACC @@ -37,7 +39,7 @@ #include <myisammrg.h> extern void yyerror(const char*); -int yylex(void *yylval); +int yylex(void *yylval, void *yythd); #define yyoverflow(A,B,C,D,E,F) if (my_yyoverflow((B),(D),(int*) (F))) { yyerror((char*) (A)); return 2; } |