which references this do-nothing block in "anonymous_plpgsql.sql":
DO $$ BEGIN RAISE NOTICE 'Hello, world.'; END $$;
It runs fine in my PostgreSQL client, but in Liquibase I always get an ArrayIndexOutOfBoundsException:
DEBUG 4/4/17 6:42 PM: liquibase: Connected to [redacted] DEBUG 4/4/17 6:42 PM: liquibase: Setting auto commit to false from true DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: select count from sms.databasechangeloglock DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: select count from sms.databasechangeloglock DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM sms.databasechangeloglock WHERE ID=1 DEBUG 4/4/17 6:42 PM: liquibase: Lock Database DEBUG 4/4/17 6:42 PM: liquibase: Executing UPDATE database command: UPDATE sms.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '10.64.21.111 (10.64.21.111)', LOCKGRANTED = '2017-04-04 18:42:10.909' WHERE ID = 1 AND LOCKED = FALSE INFO 4/4/17 6:42 PM: liquibase: Successfully acquired change log lock DEBUG 4/4/17 6:42 PM: liquibase: Computed checksum for 1491331332477 as eb0dd71e9c2405de3d87f993a981f08a DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: SELECT MD5SUM FROM sms.databasechangelog WHERE MD5SUM IS NOT NULL LIMIT 1 DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: select count from sms.databasechangelog INFO 4/4/17 6:42 PM: liquibase: Reading from sms.databasechangelog DEBUG 4/4/17 6:42 PM: liquibase: Executing QUERY database command: SELECT * FROM sms.databasechangelog ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Computed checksum for inputStream as f628dad39e0ef7b15ec039f91d8289c0 DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Computed checksum for 7:f628dad39e0ef7b15ec039f91d8289c0: as 121c4496138fa4845aca91735d100959 DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Running Changeset:ArrayIndexOutOfBoundsException.yaml::dcrews:1::null DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Changeset ArrayIndexOutOfBoundsException.yaml::dcrews:1::null DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Reading ChangeSet: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null SEVERE 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Change Set ArrayIndexOutOfBoundsException.yaml::dcrews:1::null failed. Error: null DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Release Database Lock DEBUG 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Executing UPDATE database command: UPDATE sms.databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Successfully released change log lock Unexpected error running Liquibase: Unknown Reason
SEVERE 4/4/17 6:42 PM: liquibase: ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Unknown Reason liquibase.exception.MigrationFailedException: Migration failed for change set ArrayIndexOutOfBoundsException.yaml::dcrews:1::null: Reason: java.lang.ArrayIndexOutOfBoundsException at liquibase.changelog.ChangeSet.execute(ChangeSet.java:605) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79) at liquibase.Liquibase.update(Liquibase.java:214) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.integration.commandline.Main.doMigration(Main.java:1126) at liquibase.integration.commandline.Main.run(Main.java:184) at liquibase.integration.commandline.Main.main(Main.java:103) Caused by: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:536) at java.lang.StringBuilder.append(StringBuilder.java:204) at org.postgresql.core.Parser.parseSql(Parser.java:1020) at org.postgresql.core.Parser.replaceProcessing(Parser.java:974) at org.postgresql.core.CachedQueryCreateAction.create(CachedQueryCreateAction.java:42) at org.postgresql.core.QueryExecutorBase.createQueryByKey(QueryExecutorBase.java:304) at org.postgresql.core.QueryExecutorBase.createQuery(QueryExecutorBase.java:315) at org.postgresql.jdbc.PgConnection.nativeSQL(PgConnection.java:706) at liquibase.database.jvm.JdbcConnection.nativeSQL(JdbcConnection.java:236) at liquibase.change.AbstractSQLChange.generateStatements(AbstractSQLChange.java:216) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1253) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:568) ... 7 more
For more information, use the --logLevel flag
It's not related to the RAISE NOTICE command, but seems to be any code within a plpgsql anonymous block. The database is PostgreSQL 9.6.1, but the problems appears on 9.4.7 as well.
I have the following YAML file:
changeSet:
id: dcrews:1
runOnChange: true
runInTransaction: true
splitStatements: false
endDelimiter: $$;
changes:
sqlFile:
path: anonymous_plpgsql.sql
relativeToChangelogFile: true
schemaName: sms
which references this do-nothing block in "anonymous_plpgsql.sql":
It runs fine in my PostgreSQL client, but in Liquibase I always get an ArrayIndexOutOfBoundsException:
It's not related to the RAISE NOTICE command, but seems to be any code within a plpgsql anonymous block.
The database is PostgreSQL 9.6.1, but the problems appears on 9.4.7 as well.