Differences between 2.0-RC2 and 2.0-RC3

Hi Nathan,

As you see I’ve been trying RC3 and I saw a different behavior compared with RC2.

1 - If you have a change set like this:

                           

And test.sql is:

    insert into test_table values(1, 'hello'); insert into test_table values(2, 'hello');

You run that and after that you modify the sql, instead of fail like in RC2 it does nothing. Not even a warning saying that the check-sum has changed.
Is this the new way of not fail when a changeset has been accidentally modified?

2 - If you run a change-set using RC2 that has runOnChange=“true” and then you run the same thing but using RC3 it tries to execute that even when the changeset hasn’t changed in content. So it detects that the check-sum is different while nothing has actually be modified in it.

Is this the correct behavior? and will it happen every time we update liquibase version?

Thanks a lot,
Alexis.

I fixed issue #1.  I’m not seeing #2, though.  Perhaps it was fixed by something else.  Could you try a build from trunk, or let me know if you still have problems when the next RC comes out?

Nathan

Hi Nathan,

    I checked issue #1 and it is fixed… I’m using revision 1666.

    Now I found why is issue #2, and I think it might be a problem in some cases (I can actually solve it in my case):

    In RC2 white spaces at the end of the file are used for the check-sum calculation. while in RC3+ they are trimmed and ignored.

    Here you have the case for this sqlfile:

    insert into test_table values(1, 'hello'); insert into test_table values(2, 'hello');

RC2 (my build before RC3)
    [exec] – *********************************************************************
    [exec] – Update Database Script
    [exec] – *********************************************************************
    [exec] – Change Log: test.xml
    [exec] – Ran at: 8/4/10 12:35 PM
    [exec] – Against: db@jdbc:oracle:thin:@client:1521:orcl
    [exec] – Liquibase version: 2.0-rc3-SNAPSHOT
    [exec] – *********************************************************************
    [exec] – Lock Database
    [exec] – Changeset test.xml::test-inserts::alexis::(Checksum: 2:c253005ae54a10dfd5481e7476112dd5)
    [exec] DELETE FROM test_table;
    [exec] insert into test_table values(1, ‘hello’);
    [exec] insert into test_table values(2, ‘hello’);
    [exec] INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES (‘alexis’, NULL, SYSTIMESTAMP, ‘Delete Data, SQL From File’, ‘EXECUTED’, ‘test.xml’, ‘test-inserts’, ‘2.0-rc3-SNP’, ‘2:c253005ae54a10dfd5481e7476112dd5’, 289);
    [exec] – Release Database Lock

RC6:

    [exec] – *********************************************************************
    [exec] – Update Database Script
    [exec] – *********************************************************************
    [exec] – Change Log: test.xml
    [exec] – Ran at: 8/4/10 12:29 PM
    [exec] – Against: db@jdbc:oracle:thin:@client:1521:orcl
    [exec] – Liquibase version: 2.0-rc6-SNAPSHOT
    [exec] – *********************************************************************
    [exec] Aug 4, 2010 12:29:50 PM liquibase.logging.jvm.JavaUtilLogger info
    [exec] INFO: Successfully released change log lock
    [exec] – Lock Database
    [exec] – Changeset test.xml::test-inserts::alexis::(Checksum: 2:a26beb9bad1a08e5461de1271fd7fcb5)
    [exec] DELETE FROM test_table;
    [exec] insert into test_table values(1, ‘hello’);
    [exec] insert into test_table values(2, ‘hello’);
    [exec] INSERT INTO DATABASECHANGELOG (AUTHOR, COMMENTS, DATEEXECUTED, DESCRIPTION, EXECTYPE, FILENAME, ID, LIQUIBASE, MD5SUM, ORDEREXECUTED) VALUES (‘alexis’, NULL, SYSTIMESTAMP, ‘Delete Data, SQL From File’, ‘EXECUTED’, ‘test.xml’, ‘test-inserts’, ‘2.0-rc6-SNP’, ‘2:a26beb9bad1a08e5461de1271fd7fcb5’, 289);
    [exec] – Release Database Lock

  Empty lines at the middle of the sentences are correctly included in the check-sum calculation.

  Which behavior should we spect for future releases?. Because a changeset will fail if it has empy lines at the end of the file and hasn’t runonChange=“true”

Hope this helps,
Alexis

It should always be trimming spaces from the beginning and end.  I thought I had that logic in there for a while, but I cannot tell exactly because of the amount I moved files around since RC2.  It will be stable going forward, though.

Nathan