List:Internals« Previous MessageNext Message »
From:Joseph Lukas Date:July 9 2009 3:06pm
Subject:Re: Empty var_list issue - per query variable setting GSoC project
View as plain text  
That did solve the issue I had the order wrong in how I thought it  
executed the code.  This explains a lot of it.  On a huge plus the  
statement will now set the session variable as it is supposed to.   
Next in-line is to get it to perform the query.  After that is the get  
the current value and reset the variable back.  I am very excited now  
that it works.

Joe


On Jul 9, 2009, at 3:17 AM, Sergei Golubchik wrote:

> Hi, Joseph!
>
> On Jul 08, Joseph Lukas wrote:
>> I pushed what i currently have up to launchpad. I am still having  
>> the issue
>> with empty var_list I do not know what is clearing it or whether it  
>> was
>> set-up at all properly.
>
> Okay, this turned out to be very simple:
> you have this in the parser -
>
> statement_set:
>         STATEMENT_SYM simple_option_type_list SELECT_SYM select_init2
>         {
>            LEX *lex=Lex;
>            lex->sql_command= SQLCOM_STATEMENT;
>            mysql_init_select(lex);
>            lex->option_type=OPT_SESSION;
>            lex->var_list.empty();
>            lex->one_shot_set= 0;
>            lex->autocommit= 0;
>         }
>         ;
>
> so, at first the parser will execute simple_option_type_list rule,  
> that
> will add variables to the lex->var_list, then it'll do SELECT_SYM,
> select_init2, and finally it wil get to your code in the curly  
> braces -
> where you do lex->var_list.empty().
>
> See how it's done in the normal SET - option_value_list is *after* the
> initialization code in the curly braces:
>
> set:
>          SET opt_option
>          {
>            LEX *lex=Lex;
>            lex->sql_command= SQLCOM_SET_OPTION;
>            mysql_init_select(lex);
>            lex->option_type=OPT_SESSION;
>            lex->var_list.empty();
>            lex->one_shot_set= 0;
>            lex->autocommit= 0;
>          }
>          option_value_list
>          {}
>        ;
>
> Regards / Mit vielen Grüßen,
> Sergei
>
> -- 
>   __  ___     ___ ____  __
>  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
> / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server  
> Architect
> /_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München  
> 161028
>       <___/                  Sonnenallee 1, 85551 Kirchheim- 
> Heimstetten
> Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
> Vorsitzender des Aufsichtsrates: Martin Häring

Thread
Empty var_list issue - per query variable setting GSoC projectJoseph Lukas9 Jul
  • Re: Empty var_list issue - per query variable setting GSoC projectSergei Golubchik9 Jul
    • Re: Empty var_list issue - per query variable setting GSoC projectJoseph Lukas9 Jul
    • Implementation - per query variable setting GSoC projectJoseph Lukas9 Jul
      • Re: Implementation - per query variable setting GSoC projectSergei Golubchik11 Jul
        • Re: Implementation - per query variable setting GSoC projectJoseph Lukas11 Jul
          • Re: Implementation - per query variable setting GSoC projectSergei Golubchik12 Jul