From: Sergei Golubchik Date: August 11 2009 3:51pm Subject: Re: Fwd: GSoC Week 14 - August 2 - August 9 per query variable settings List-Archive: http://lists.mysql.com/soc/442 Message-Id: <20090811155115.GF8015@sergbook.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Hi, Joseph! On Aug 10, Joseph Lukas wrote: > A quick question on 9. SET STATEMENT var1=... FOR SET SESSION var=... > I thought about this one for a little bit in which you change the same > variable 2 times. This statement I know would execute as: it would > store the current variable, the SET SESSION would override the > temporary set but would return to the old setting at the end not the > one after the FOR. I am unsure if I should have coded for this to > change to the SET SESSION after the running of the function. This > would also be true if a stored procedure contained a SET SESSION that > had a SET STATEMENT on the outside of execute. I figured that this > would have been described in how the function works and not to do it. > I would believe that the same variable would not be changed in the > statement in 99.99% of the queries. This would be unless they wanted > to override the SET inside the procedure and return to original then > they would use a SET STATEMENT which may be useful in rare cases. Eh... first I don't see a question here :) Anyway, I think the behavior you've implemented is fine - it's a corner case anyway, and what is "correct" here can be argued about. Still, please add such a test to the test file. To show that such a syntax is possible, it doesn't cause a crash, it produces the expected (by the implementor, at least) results. Regards / Mit vielen Grüßen, Sergei -- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Sergei Golubchik / /|_/ / // /\ \/ /_/ / /__ 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