Comments - IF
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
Roberto,
I was having this same issue, then was able to figure it out.
I was using a script to create a SPROC that contained the IF statement, and every time I got the same error you did.
I then used the "DELIMITER $$" statement at the top of my script. Then I changed the ';' on every statement outside of the SPROC that was defining. As an example:
DELIMITER $$ USE my_db $$ DROP PROCEDURE IF EXISTS my_sproc $$ CREATE PROCEDURE my_sproc () BEGIN IF 1=1 THEN SELECT 1; END IF; END $$If you do the same as above, but take out the delimiter statement and change all the '$$'s to ';'s, you'll get the same error again. It seems like it was getting confused somehow on the statements inside and outside the "IF" if they both expected the same delimiter.