diff options
author | Georgi Kodinov <joro@sun.com> | 2009-10-23 16:54:58 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-10-23 16:54:58 +0300 |
commit | d539c1570b6ab23394709192c0bebc4ea736d63d (patch) | |
tree | 6ef7a0f2df438b968ce77ae7645336e8af6d8d72 /sql/sql_yacc.yy | |
parent | 88084d67634d4660e097e6937df8ed6194241166 (diff) | |
download | mariadb-git-d539c1570b6ab23394709192c0bebc4ea736d63d.tar.gz |
Revert the fix for bug #47627 as it's causing the regression tests in pb2 to
fail.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 61 |
1 files changed, 14 insertions, 47 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a837a10325b..37c583ad572 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -11783,17 +11783,8 @@ option_type: ; option_type2: - /* empty */ - { - $$= OPT_DEFAULT; - Lex->option_type= OPT_DEFAULT; - } - | ONE_SHOT_SYM - { - Lex->one_shot_set= 1; - $$= OPT_SESSION; - Lex->option_type= OPT_SESSION; - } + /* empty */ { $$= OPT_DEFAULT; } + | ONE_SHOT_SYM { Lex->one_shot_set= 1; $$= OPT_SESSION; } ; opt_var_type: @@ -11804,26 +11795,10 @@ opt_var_type: ; opt_var_ident_type: - /* empty */ - { - $$=OPT_DEFAULT; - Lex->option_type= OPT_DEFAULT; - } - | GLOBAL_SYM '.' - { - $$=OPT_GLOBAL; - Lex->option_type= OPT_GLOBAL; - } - | LOCAL_SYM '.' - { - $$=OPT_SESSION; - Lex->option_type= OPT_SESSION; - } - | SESSION_SYM '.' - { - $$=OPT_SESSION; - Lex->option_type= OPT_SESSION; - } + /* empty */ { $$=OPT_DEFAULT; } + | GLOBAL_SYM '.' { $$=OPT_GLOBAL; } + | LOCAL_SYM '.' { $$=OPT_SESSION; } + | SESSION_SYM '.' { $$=OPT_SESSION; } ; ext_option_value: @@ -12063,22 +12038,8 @@ internal_variable_name: sp_pcontext *spc= lex->spcont; sp_variable_t *spv; - /* - We have to lookup here since local vars can shadow sysvars. - - We also have to inspect the option_type first since the variable - identifier might have been prefixed with @@session or @@global - prefixes. Without this check we would wrongly identify them - as SP local variables. - */ - if (lex->option_type == OPT_DEFAULT && spc && - (spv= spc->find_variable(&$1))) - { - /* An SP local variable */ - $$.var= NULL; - $$.base_name= $1; - } - else + /* We have to lookup here since local vars can shadow sysvars */ + if (!spc || !(spv = spc->find_variable(&$1))) { /* Not an SP local variable */ sys_var *tmp=find_sys_var(thd, $1.str, $1.length); @@ -12095,6 +12056,12 @@ internal_variable_name: lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; } } + else + { + /* An SP local variable */ + $$.var= NULL; + $$.base_name= $1; + } } | ident '.' ident { |