Mysql – Adding a MySQL StoredProcedure causes not responding state

MySQLstored-proceduresxampp

I'm on Windows 7 ultimate 32bit + xampp 1.7.2 [MySQL v5.1.37]

This is my stored procedure :

delimiter //
CREATE PROCEDURE updatePoints(IN parentid INT(5),IN userid INT(5))
DECLARE chpoints INT(5);
BEGIN
 SELECT points INTO chpoints FROM quiz_challenges WHERE id = parentid;
 UPDATE quiz_users SET points = points + chpoints WHERE forumid=userid;
END;
//                                   
delimiter ;

At first it was showing error 1064 while creating stored procedure.
I added delimiters part and when I tried running the query from phpmyadmin, Firefox went into not responding state.
After that I started Internet Explorer and tried opening my pages which use the same database, it worked fine. However, I tried opening phpmyadmin and IE went into not responding state as well.
I restarted both servers. Later restarted PC. Tried again but its same behavior.

So whats wrong with this tiny little code ? Am I missing something which might be causing infinite loop ?

Thanks

Best Answer

In my experience phpmyadmin does not like the use of delimiter // inside the SQL query window. Instead, there is a "delimiter" text box in the phpmyadmin SQL query window, the contents of which are set to ";" by default. Enter "//" in this text box instead of ";", and try your query with the delimiter // and delimiter ; lines omitted.