Hello guys, can anyone help me with this?

CREATE TRIGGER trigger_posts BEFORE INSERT ON tableposts FOR EACH ROW
BEGIN
IF NEW.x IS NULL AND NEW.y IS NULL THEN
CALL raise_application_error(1234, 'Error - check Date and value');
END IF;
END

The error log is:

SQL query:

CREATE TRIGGER trigger_posts BEFORE INSERT ON tableposts
FOR EACH
ROW
BEGIN
IF NEW.x IS NULL
AND NEW.y IS NULL
THEN CALL raise_application_error( 1234, 'Error - check Date and value' ) ;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

Mysql version: 5.1

I've also tryed putting x and y in parenthesis:
IF ((NEW.x IS NULL) AND (NEW.y IS NULL)) THEN
But this doesn't work.