Informix can't create formatted sql procedure
See original GitHub issueEnvironment
Mac, using docker containers for db
Liquibase Version: Liquibase Pro 4.0.0
Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.> CLI
Liquibase Extension(s) & Version: n/a
Database Vendor & Version: IBM Informix Dynamic Server Version 14.10.FC3DE
Operating System Type & Version: Mac 10.15.5
Description
I can run the following procedure in DBeaver and it works:
CREATE PROCEDURE raise_prices ( per_cent INT)
UPDATE stock SET unit_price = unit_price + (unit_price * (per_cent/100) );
END PROCEDURE;
But can’t get it to work as a changeset
Steps To Reproduce
- Make sure liquibase.properties is pointing to an Informix DB
- Add the following changeset to your changelog
--changeset ronak:5
--comment: test out stored logic: Procedures
CREATE PROCEDURE raise_prices ( per_cent INT)
UPDATE stock SET unit_price = unit_price + (unit_price * (per_cent/100) );
END PROCEDURE;
- Save
- Run liquibase update
List the steps to reproduce the behavior.
- I ran my container with the following calls: docker pull ibmcom/informix-developer-database docker run --name ronakInformix -e DBSERVERNAME=dbserver -e LICENSE=accept -e LOCAL=true -p 9088:9088 -e DBA_USER=test -e DBA_PASS=test ibmcom/informix-developer-database
Actual Behavior
Console output:
ronak@Ronaks-MacBook-Pro informix % liquibase update Liquibase Pro 4.0.0 by Datical licensed to Liquibase Pro Customer until Mon May 17 19:00:00 CDT 2021 Starting Liquibase at 21:14:47 (version 4.0.0 #19 built at 2020-07-13 19:45+0000) Unexpected error running Liquibase: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] For more information, please use the --logLevel flag [2020-08-03 21:14:48] SEVERE [liquibase.integration] Unexpected error running Liquibase: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:112) at liquibase.Liquibase$1.run(Liquibase.java:206) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Liquibase.runInScope(Liquibase.java:1790) at liquibase.Liquibase.update(Liquibase.java:183) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.commandline.Main.doMigration(Main.java:1543) at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:316) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.integration.commandline.Main$1.run(Main.java:315) at liquibase.integration.commandline.Main$1.run(Main.java:166) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:144) at liquibase.integration.commandline.Main.run(Main.java:166) at liquibase.integration.commandline.Main.main(Main.java:145) Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:670) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49) at liquibase.changelog.ChangeLogIterator$2$1.run(ChangeLogIterator.java:99) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:91) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:64) … 22 more Caused by: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:398) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:154) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1272) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1254) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:635) … 38 more Caused by: java.sql.SQLSyntaxErrorException: A syntax error has occurred. at com.informix.util.IfxErrMsg.buildExceptionWithMessage(IfxErrMsg.java:408) at com.informix.util.IfxErrMsg.buildIsamException(IfxErrMsg.java:401) at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3021) at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3272) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2269) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2194) at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2104) at com.informix.jdbc.IfxResultSet.executeExecute(IfxResultSet.java:302) at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1006) at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:986) at com.informix.jdbc.IfxStatement.executeBody(IfxStatement.java:738) at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:680) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:394) … 43 more
Expected/Desired Behavior
A clear and concise description of what happens in the software after this pull request. DBeaver is able to execute the sql, I expect LB to also.
Screenshots (if appropriate)
If applicable, add screenshots to help explain your problem.
Additional Context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Hi @ro-rah . Thanks for the detailed explanation and recreation steps of this issue. We will add it to our list and process it as we can. But to answer your question, it looks as though from this issue that procedures may be broken.
Closing!