The <property /> definition for column type does not work in version 4.8.0, which works well in 3.x.x
See original GitHub issueEnvironment
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.
<databaseChangeLog ...>
<property name="bytesarray_type" value="BYTEA" global="false" dbms="postgresql" />
<property name="bytesarray_type" value="java.sql.Types.BLOB" global="false" dbms="hana" />
<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>
Steps To Reproduce
- Using postgres DB in docker image ‘postgres:12-alpine’.
- Using a changelog as above.
- Run the changelog with ‘liquibase.integration.spring.SpringLiquibase.performUpdate’.
- The exception will happened with handle above ‘create table’ change set.
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)
If applicable, add screenshots to help explain your problem.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Release notes for SQL Server Management Studio (SSMS)
There is a known problem due to incorrect data in msdb. To resolve, remove backup history. For example EXEC msdb..sp_delete_backuphistory @ ...
Read more >c# - Could not load file or assembly 'System.Data.SqlClient ...
Each library runs under the process of the main application. So the main application needs to know to load the SqlClient DLL.
Read more >What's new in IBM Cloud Pak for Data?
AI Factsheets is a new service that replaces the Factsheets functionality in Watson™ Knowledge Catalog. Data Virtualization is now Watson Query; RStudio Server ......
Read more >Cisco IoT Field Network Director User Guide, Release 4.8.x
The troubleshooting report types available are All TLVs, Connectivity, General, Register, ... In IoT FND 4.7.x, this feature is enabled in the software....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nvoxland I think it is not just a friendly exception message. The root cause is that 2 properties will be duplicated if they have same target DB and value.
Please look at below liquibase script:
The script is expected to support 2 type DB. For postgres, ‘BYTEA’ column should be used for column for ‘bytearray’ and ‘messageproperties’. But in hana DB, these 2 columns should used different DB type.
But due to below isDuplicate logic. (1) & (2) will be classified as duplicated due to they have same target DB, value and label (no label). Finally, only one of (1) & (2) will be left.
ChangeLogParameter::isDuplicate
I think that key of these 2 parameters should be add to duplicated check as well.
The
java.lang.ArrayIndexOutOfBoundsException
happens when the property placeholder could not be replaced for some reason. In that case the${bytesarray_type}
is forwarded as is to theDataTypeFactory
. TheDataTypeFactory
identifies the curly braces as some kind of embedded information in the type, i.e.int{autoIncrement:true}
, and fails accessing the expected “value” after splitting the content of the curly braces by colon.But: the example you provided works as long as postgresql or hana are used as database.
Question for the maintainers: Is this behaviour actually expected? In my opinion there are only 2 sane solutions:
Just leaving the property placeholder in there and failing in later stages is not a good solution tbh.