summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2008-07-14 19:43:12 -0600
committerMarc Alff <marc.alff@sun.com>2008-07-14 19:43:12 -0600
commit566e3389c2b91ce03a04f574fda562c02b7d0692 (patch)
tree302ecb26a02762cc90a264a5d6a12c76a15939fd /sql/sql_yacc.yy
parentbbecb196087ee236885fcd4bfc99389d3edf853a (diff)
parent504f7e2d0f742985e72ee2ebffe704093f8e602d (diff)
downloadmariadb-git-566e3389c2b91ce03a04f574fda562c02b7d0692.tar.gz
Bug#35577, manual merge mysql-5.0-bugteam -> mysql-5.1-bugteam
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy81
1 files changed, 29 insertions, 52 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3652fe8d6b4..ccd64c24960 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -28,6 +28,7 @@
#define YYPARSE_PARAM yythd
#define YYLEX_PARAM yythd
#define YYTHD ((THD *)yythd)
+#define YYLIP (& YYTHD->m_parser_state->m_lip)
#define MYSQL_YACC
#define YYINITDEPTH 100
@@ -121,7 +122,7 @@ const LEX_STRING null_lex_str= {0,0};
void my_parse_error(const char *s)
{
THD *thd= current_thd;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= & thd->m_parser_state->m_lip;
const char *yytext= lip->get_tok_start();
/* Push an error into the error stack */
@@ -1356,11 +1357,11 @@ query:
MYSQL_YYABORT;
}
thd->lex->sql_command= SQLCOM_EMPTY_QUERY;
- thd->m_lip->found_semicolon= NULL;
+ YYLIP->found_semicolon= NULL;
}
| verb_clause
{
- Lex_input_stream *lip = YYTHD->m_lip;
+ Lex_input_stream *lip = YYLIP;
if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) &&
! lip->stmt_prepare_mode &&
@@ -1386,7 +1387,7 @@ query:
| verb_clause END_OF_INPUT
{
/* Single query, not terminated. */
- YYTHD->m_lip->found_semicolon= NULL;
+ YYLIP->found_semicolon= NULL;
}
;
@@ -1917,7 +1918,7 @@ ev_sql_stmt:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
/*
This stops the following :
@@ -2574,7 +2575,7 @@ sp_proc_stmt_statement:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
lex->sphead->reset_lex(thd);
lex->sphead->m_tmp_query= lip->get_tok_start();
@@ -2583,7 +2584,7 @@ sp_proc_stmt_statement:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
sp_head *sp= lex->sphead;
sp->m_flags|= sp_get_flags_for_command(lex);
@@ -6455,17 +6456,13 @@ select_item:
remember_name:
{
- THD *thd= YYTHD;
- Lex_input_stream *lip= thd->m_lip;
- $$= (char*) lip->get_cpp_tok_start();
+ $$= (char*) YYLIP->get_cpp_tok_start();
}
;
remember_end:
{
- THD *thd= YYTHD;
- Lex_input_stream *lip= thd->m_lip;
- $$= (char*) lip->get_cpp_tok_end();
+ $$= (char*) YYLIP->get_cpp_tok_end();
}
;
@@ -9645,7 +9642,7 @@ load:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
if (lex->sphead)
{
@@ -9686,10 +9683,7 @@ load_data:
}
opt_duplicate INTO
{
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
- lex->fname_end= lip->get_ptr();
+ Lex->fname_end= YYLIP->get_ptr();
}
TABLE_SYM table_ident
{
@@ -9924,7 +9918,7 @@ param_marker:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
Item_param *item;
if (! lex->parsing_options.allows_variable)
{
@@ -9956,7 +9950,7 @@ literal:
| NULL_SYM
{
$$ = new Item_null();
- YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
+ YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT;
}
| FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); }
| TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); }
@@ -10086,7 +10080,7 @@ simple_ident:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
sp_variable_t *spv;
sp_pcontext *spc = lex->spcont;
if (spc && (spv = spc->find_variable(&$1)))
@@ -10776,7 +10770,7 @@ option_type_value:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
if (lex->sphead)
{
@@ -10807,7 +10801,7 @@ option_type_value:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
if (lex->sphead)
{
@@ -12076,19 +12070,17 @@ view_select:
{
THD *thd= YYTHD;
LEX *lex= Lex;
- Lex_input_stream *lip= thd->m_lip;
lex->parsing_options.allows_variable= FALSE;
lex->parsing_options.allows_select_into= FALSE;
lex->parsing_options.allows_select_procedure= FALSE;
lex->parsing_options.allows_derived= FALSE;
- lex->create_view_select.str= (char *) lip->get_cpp_ptr();
+ lex->create_view_select.str= (char *) YYLIP->get_cpp_ptr();
}
view_select_aux view_check_option
{
THD *thd= YYTHD;
LEX *lex= Lex;
- Lex_input_stream *lip= thd->m_lip;
- uint len= lip->get_cpp_ptr() - lex->create_view_select.str;
+ uint len= YYLIP->get_cpp_ptr() - lex->create_view_select.str;
void *create_view_select= thd->memdup(lex->create_view_select.str, len);
lex->create_view_select.length= len;
lex->create_view_select.str= (char *) create_view_select;
@@ -12131,26 +12123,20 @@ trigger_tail:
ON
remember_name /* $7 */
{ /* $8 */
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
- lex->raw_trg_on_table_name_begin= lip->get_tok_start();
+ Lex->raw_trg_on_table_name_begin= YYLIP->get_tok_start();
}
table_ident /* $9 */
FOR_SYM
remember_name /* $11 */
{ /* $12 */
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
- lex->raw_trg_on_table_name_end= lip->get_tok_start();
+ Lex->raw_trg_on_table_name_end= YYLIP->get_tok_start();
}
EACH_SYM
ROW_SYM
{ /* $15 */
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
sp_head *sp;
if (lex->sphead)
@@ -12254,7 +12240,7 @@ sf_tail:
{ /* $5 */
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
sp_head *sp;
const char* tmp_param_begin;
@@ -12282,11 +12268,7 @@ sf_tail:
sp_fdparam_list /* $6 */
')' /* $7 */
{ /* $8 */
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
-
- lex->sphead->m_param_end= lip->get_cpp_tok_start();
+ Lex->sphead->m_param_end= YYLIP->get_cpp_tok_start();
}
RETURNS_SYM /* $9 */
{ /* $10 */
@@ -12323,7 +12305,7 @@ sf_tail:
{ /* $14 */
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
+ Lex_input_stream *lip= YYLIP;
lex->sphead->m_chistics= &lex->sp_chistics;
lex->sphead->set_body_start(thd, lip->get_cpp_tok_start());
@@ -12408,33 +12390,28 @@ sp_tail:
}
'('
{
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
const char* tmp_param_begin;
- tmp_param_begin= lip->get_cpp_tok_start();
+ tmp_param_begin= YYLIP->get_cpp_tok_start();
tmp_param_begin++;
- lex->sphead->m_param_begin= tmp_param_begin;
+ Lex->sphead->m_param_begin= tmp_param_begin;
}
sp_pdparam_list
')'
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
- lex->sphead->m_param_end= lip->get_cpp_tok_start();
+ lex->sphead->m_param_end= YYLIP->get_cpp_tok_start();
bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics));
}
sp_c_chistics
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- Lex_input_stream *lip= thd->m_lip;
lex->sphead->m_chistics= &lex->sp_chistics;
- lex->sphead->set_body_start(thd, lip->get_cpp_tok_start());
+ lex->sphead->set_body_start(thd, YYLIP->get_cpp_tok_start());
}
sp_proc_stmt
{