I am having an issue with any Liquibase 4.0 or higher with Teradata. To test, I created a new Teradata database and a xml file with a single changeset:
<?xml version="1.0" encoding="UTF-8"?>
<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-4.24.xsd">
<changeSet id="test" author="klemke">
<sql>
<![CDATA[
create procedure DBname.SP_TEST(IN "param1" VARCHAR(30))
BEGIN
INSERT INTO TEST_TABLE (COL1) VALUES (:param1);
END;
]]>
</sql>
</changeSet>
</databaseChangeLog>
When I execute it, or any other Create/Replace Procedure call, whether it be in or , I get:
Caused by: liquibase.exception.DatabaseException: [Teradata Database] [TeraJDBC 20.00.00.13] [Error 5526] [SQLState HY000] Stored Procedure is not created/replaced due to error(s).
I can log in as the same user I am connecting Liquibase as and create the stored procedure manually without an issue. I can create a tables using Liqubase, just not stored procedures.
Stack trace from Liquibase changeset failure:
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:785)
at liquibase.changelog.visitor.UpdateVisitor.executeAcceptedChange(UpdateVisitor.java:118)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:68)
at liquibase.changelog.ChangeLogIterator$2.lambda$run$0(ChangeLogIterator.java:110)
at liquibase.Scope.lambda$child$0(Scope.java:184)
at liquibase.Scope.child(Scope.java:193)
at liquibase.Scope.child(Scope.java:183)
at liquibase.Scope.child(Scope.java:162)
at liquibase.Scope.child(Scope.java:250)
at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:100)
at liquibase.Scope.lambda$child$0(Scope.java:184)
at liquibase.Scope.child(Scope.java:193)
at liquibase.Scope.child(Scope.java:183)
at liquibase.Scope.child(Scope.java:162)
at liquibase.Scope.child(Scope.java:250)
at liquibase.Scope.child(Scope.java:254)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:74)
… 38 more
And from error report:
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:468)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:177)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1291)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1273)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:744)
… 54 more
I have tried with Liquibase 4.24.0, 4.19.1, 4.9.1 - they all had the same error.
If I use 3.4.1, it works fine, no matter if it is an existing database or a new one.
Teradata 17.20.03.02
Classpath includes tdgssconfig.jar, liquibase-teradata.jar, and terajdbc.jar; also tried terajdbc4.jar.
Any ideas why it cannot create a stored procedure? Or is there a way to get more information on the cause of the error since the error code seems to be pretty generic?