Checksum validation failed after Liquibase upgrade (3.1.1 -> 3.2.0)
Description
Environment
MSSQL
Activity
Nathan Voxland July 22, 2014 at 9:04 PM
Fixed handling of 0.0 style numbers with 3.2.2
Gerd Behrmann July 22, 2014 at 5:50 PM
I should add that we use postgresql (I just noticed the bug refers to an mssql environment).
Gerd Behrmann July 22, 2014 at 11:17 AM
We still see issues with this in 3.2.1. For the following change:
<insert tableName="t_inodes">
<column name="ipnfsid" value="000000000000000000000000000000000000"/>
<column name="itype" valueNumeric="16384"/>
<column name="imode" valueNumeric="511"/>
<column name="inlink" valueNumeric="2"/>
<column name="iuid" valueNumeric="0"/>
<column name="igid" valueNumeric="0"/>
<column name="isize" valueNumeric="512"/>
<column name="iio" valueNumeric="0"/>
<column name="ictime" valueDate="CURRENT_TIMESTAMP"/>
<column name="iatime" valueDate="CURRENT_TIMESTAMP"/>
<column name="imtime" valueDate="CURRENT_TIMESTAMP"/>
</insert>
liquibase 3.1.1 calculates:
22 Jul 2014 13:14:01 (PnfsManager) [] classpath:org/dcache/chimera/changelog/changelog-master.xml: org/dcache/chimera/changelog/changeset-1.8.0.xml::2::tigran: Computed checksum for insert:[
columns=[
[
name="ipnfsid"
value="000000000000000000000000000000000000"
],
[
name="itype"
valueNumeric="16384"
],
[
name="imode"
valueNumeric="511"
],
[
name="inlink"
valueNumeric="2"
],
[
name="iuid"
valueNumeric="0"
],
[
name="igid"
valueNumeric="0"
... [truncated in log] as 9be8fd9160f8043525d6d0c77f2f2601
while liquibase 3.2.1 calculates:
22 Jul 2014 13:05:51 (PnfsManager) [] classpath:org/dcache/chimera/changelog/changelog-master.xml: org/dcache/chimera/changelog/changeset-1.8.0.xml::2::tigran: Computed checksum for insert:[
columns=[
[
name="ipnfsid"
value="000000000000000000000000000000000000"
],
[
name="itype"
valueNumeric="16384.0"
],
[
name="imode"
valueNumeric="511.0"
],
[
name="inlink"
valueNumeric="2.0"
],
[
name="iuid"
valueNumeric="0.0"
],
[
name="igid"
valueNumeric... [truncated in log] as 586b086e924eb002b1a6568f75f98bfd
So the new version converts integers to floating point values before calculating the checksum. That doesn't look like an edge case to me.
Dmitry Gil July 10, 2014 at 6:47 PM
Thank you!
Nathan Voxland July 10, 2014 at 6:08 PM
Fixed
After upgrading Liquibase from 3.1.1 to 3.2.0 we got multiple validation failed errors due to checksum changes. Seems that all failed changesets contain addColumn refactoring with defaultValueNumeric attribure, for example a checksum for the following changeset was changed in new version:
<changeSet author="me" id="123"> <addColumn tableName="MyTable"> <column name="MyColumn" type="BIT" defaultValueNumeric="0"> <constraints nullable="false"/> </column> </addColumn> </changeSet>