title: How to fix SQL syntax error using liquibase and mysql to create trigger
body: <p>I am setting up first liquibase maven project for a MySQL DB.  Been fine up to creating the triggers.</p>
  
  <p>I believe it is an issue with liquibase and JDBC not correctly handling a multiple statement SQL, but I cannot figure out what I am missing. </p>
  
  <p>Here are my pom dependancies</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;dependency&gt;
        &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
        &lt;artifactId&gt;liquibase-parent&lt;/artifactId&gt;
        &lt;version&gt;3.5.3&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
        &lt;artifactId&gt;liquibase-core&lt;/artifactId&gt;
        &lt;version&gt;3.5.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;mysql&lt;/groupId&gt;
        &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;version&gt;5.1.46&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
        &lt;artifactId&gt;liquibase-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.6.3&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>This is my liquibase include file</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"&gt;
  
    &lt;changeSet id="event_horizon_1_0_0" author="lmtyler" dbms="mysql"&gt;
      &lt;sql&gt;
        drop trigger if exists ai_event_approval;
      &lt;/sql&gt;
    &lt;/changeSet&gt;
  
    &lt;changeSet id="event_horizon_1_0_1" author="lmtyler" dbms="mysql"&gt;
      &lt;sqlFile splitStatements="false" stripComments="false" endDelimiter="DONE" path="01__ai_event_approval.sql" relativeToChangelogFile="true" /&gt;
    &lt;/changeSet&gt;
  
  &lt;/databaseChangeLog&gt;
  </code></pre>
  
  <p>This is my sql file</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE DEFINER ='evclient'@'%' TRIGGER ai_event_approval
      AFTER INSERT
      ON event_approval
      FOR EACH row
  begin
      insert into event_approval_log (rowAction,
                                      actionTs,
                                      event,
                                      requestorEmail,
                                      requestReason,
                                      statusType,
                                      approverUserId,
                                      approverReason,
                                      lastChangTs)
          values ('I',
                  current_timestamp(6),
                  new.event,
                  new.requestorEmail,
                  new.requestReason,
                  new.statusType,
                  new.approverUserId,
                  new.approverReason,
                  new.lastChangTs);
  end;
  # DONE
  </code></pre>
  
  <p>I expected that by setting the splitStatements, stripComments, and endDelimiter that I would get liquibase to send the whole SQL as one thru JDBC.</p>
  
  <p>But I am getting this error</p>
  
  <pre><code>[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.6.3:update (default) on project event-horizon-mysql: Error setting up or running Liquibase: Migration failed for change set /Users/lmtyler/OneDrive - Walmart Inc/workspace/code/event-horizon/event-horizon-mysql/src/main/java/resources/liquibase/schema/triggers/02__au_event_approval.sql::event_horizon_1_0_1::lmtyler:
  [ERROR]      Reason: liquibase.exception.DatabaseException: 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 23 [Failed SQL: CREATE TRIGGER au_event_approval
  [ERROR]     AFTER UPDATE
  [ERROR]     ON event_approval
  [ERROR]     FOR EACH row
  [ERROR] begin
  [ERROR]     insert into event_approval_log (rowAction,
  [ERROR]                                     actionTs,
  [ERROR]                                     event,
  [ERROR]                                     requestorEmail,
  [ERROR]                                     requestReason,
  [ERROR]                                     statusType,
  [ERROR]                                     approverUserId,
  [ERROR]                                     approverReason,
  [ERROR]                                     lastChangTs)
  [ERROR]     values ('U',
  [ERROR]             current_timestamp(6),
  [ERROR]             new.event,
  [ERROR]             new.requestorEmail,
  [ERROR]             new.requestReason,
  [ERROR]             new.statusType,
  [ERROR]             new.approverUserId,
  [ERROR]             new.approverReason,
  [ERROR]             new.lastChangTs)]
  </code></pre>