Error when declaring mysql trigger

When I have a changeset with a element, whose contents are:

    CREATE TRIGGER `partner_trg` AFTER UPDATE ON `partner` FOR EACH ROW begin       IF NEW.demo_state = true THEN update portal set is_active = false where partner_id = NEW.id;       END IF;       end;

Liquibase (v 1.9.3) reports:

" Error setting up or running Liquibase: Migration failed for change set … Caused By: 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 2"

I’ve taken the same string and executed it via JDBC, so I’m quite certain the syntax is correct.  Has anyone experienced anything similar?  Are there strategies for dealing with this problem?

I’m evaluating liquibase to handle our project.  Although we have only a couple triggers, if Liquibase is unable to handle them, I’ll have to eliminate it as a candidate (even though there are some features I really like).

Thank you,

~hf

Has anyone had to do anything similar?  Is

I ended up using the element.  For anyone who encounters a similar issue, I also had to ensure the  endDelimiter and splitStatements attributes defined, set to “” and “false” respectively.

Glad you found that. You should be able to use with the splitStatements=“false” attribute as well.  The reason is that JDBC requires you to pass in one statement at a time, it cannot have the database parse statements apart, so we do a split on ;'s by default.  Setting splitStatents=“false” will stop if from doing that and send the whole trigger to the database at once.

Nathan