New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The <property /> definition for column type does not work in version 4.6.1, which works well in 3.x.x #2231
Comments
Hi @JosephCen Thanks for writing up this issue. I think the problem may be more around the byte array definition that in the property substitution. To validate change your property value to TEXT or some other know column type and if it works then we are down to the bytearray type. If it does not work, then it may be around property substitution. |
@molivasdat After more investigate, I found the issue will be reproduce when there are more than 1 <databaseChangeLog ...>
<property name="bytesarray_type" value="BYTEA" global="false" dbms="postgresql" />
<property name="bytesarray_type" value="BYTEA" global="false" dbms="oracle" />
<changeSet author="i521084" id="1583641912012-4">
<createTable tableName="asyncevent">
<column name="id" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="asyncevent_pkey"/>
</column>
<column name="messagebodybytes" type="${bytesarray_type}"/>
<!-- ... -->
</createTable>
</changeSet>
</databaseChangeLog> But the reason why |
@molivasdat @wwillard7800 I guess I found the reason why this issue will happen. My question is why we need to remove duplicate key property. As you know that these 2 properties may have different dbms setting. |
Hi @JosephCen Thanks for the feedback. We are checking into this. |
@molivasdat Thanks for quick reply. I just added some comment in relevant PR. Please take a look. BTW, whether there is a SNAPSHOT version I can get and test at my work machine when you finish the fix. |
@JosephCen there are snapshot builds that get attached to each PR. If you click on the "checks" tab at the top, you can get to the most recent build which has them. There are a few artifacts. The one named |
@nvoxland I am afraid that I still do not get the place for download the liquibase-core.jar for this current PR. |
Sorry for the slow reply @JosephCen We're working on a more direct way to get the artifacts, but you can get it from https://github.com/liquibase/liquibase/pull/2351/checks which has an "artifacts" link/dropdown on the top. In there is |
This bug reproduces if the JDBC URL matches the dbms provided in the first property in a set of changelog properties. Specifically, given a changelog like:
When I swap the order of the properties in my changelog, I no longer get an error connecting with Postgres but do get the error connecting with MySQL.
Test Environment
|
Environment
Mac OS, postgres-12
Liquibase Version: 4.6.1
Liquibase Integration & Version: spring boot
Liquibase Extension(s) & Version: <n/a>
Database Vendor & Version: postgres-12 in container 'postgres:12-alpine'
Operating System Type & Version: Mac OS
Description
An exception
java.lang.ArrayIndexOutOfBoundsException
happened when run with below change log.I think the root cause is that defined
<property />
is not parsed well when Liquibase handle above change log. Then a column with type${bytesarray_type}
is passed to following logic and result an 'ArrayIndexOutOfBoundsException' thrown at below code line.DataTypeFactory
Steps To Reproduce
Actual Behavior
An exception
ArrayIndexOutOfBoundsException
happened.Expected/Desired Behavior
Relevant table should be created with above change log. And the same change log works well under Liquibase version 3.x.x.
Screenshots (if appropriate)
Exception call stack:
Additional Context
We just follow below document create relevant change log and there is no update against below Liquibase document.
https://docs.liquibase.com/concepts/basic/changelog-property-substitution.html
The text was updated successfully, but these errors were encountered: