From: Sergei Golubchik Date: August 5 2009 12:20pm Subject: Re: DELIMETER problem in testing, and other testing stuff List-Archive: http://lists.mysql.com/internals/37250 Message-Id: <20090805122016.GB17646@sergbook.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Hi, Joseph! On Aug 04, Joseph Lukas wrote: > I am trying to test the command in using a stored function. The log file > stops at the DELIMITER every time and will not set however I have no issues > with running the commands outside the test suite in normal MySQL. The > content of the test is at the bottom of the e-mail. I'll reply to this below > I also do realize that the variables I am setting do not really have > anything to do with the commands in the test. I am mainly running the test > in order to check the function with different types of commands. That's fine. > So I figured I should simply be testing that they are set, returned, > and works properly after errors and with various commands. Yes, it's ok. > A question as well of how do you change the date_format variable, or any > other date type variable to another setting such as %M/%D/%Y or similar? You don't. The manual says "This variable is unused." > DELIMITER : > CREATE FUNCTION myProc (cost DECIMAL(10,2)) > RETURNS DECIMAL(10,2) > > SQL SECURITY DEFINER > > tax: BEGIN > DECLARE order_tax DECIMAL(10,2); > SET order_tax = cost * .05; > RETURN order_tax; > END: > DELIMITER ; Two problems. First - you have the delimiter (colon) in the body of your function. Try a different delimiter, e.g. | Second - see how delimiter is used in, e.g., sp.test: delimiter |; create procedure empty() begin end| delimiter ;| That is, you need to terminate the delimiter command with the *old* delimiter 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