LiquiBase stored procedure creation failing

Viewed 2491

I am trying to create a stored procedure on my database through LiquiBase. I've tried using the endDelimiter tag in the changeset as well and nothing seems to be working here.

The changelog is as follows:

    <changeSet id="create-proc" context="common" author="adamstark" failOnError="true" runOnChange="true">
    <sqlFile path="../stored_procs/proc.sql"
             relativeToChangelogFile="true"
             splitStatements="false"/>
    <rollback>
        DROP PROCEDURE IF EXISTS `proc`;
    </rollback>
</changeSet>

The SQL is as follows:

DELIMITER $$
USE db$$
CREATE PROCEDURE `proc`()
  BEGIN
    Query 1
    Query 2
  END $$

I've verified that I can run the create procedure sql from a MySQL client, however I keep getting errors from liquibase saying the following:

Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER $$

As I stated earlier I tried using the endDelimiter property, and my sql statement just immediately fails at the beginning of the query regardless of if I have the DELIMITER $$ line.

0 Answers
Related