sql tag - Exception not caught

I’m using Liquibase 1.9.5 on SQL Server 2005 and it seems that under a specific circumstance exceptions are not getting caught from some of my changeSets that contain a “sql” tag where either the splitstatements or stripcomments attributes are specified.

When the “sql” tag that contains a SELECT query that is processed successfully, followed by some other DML statement such as an INSERT statement that fails, the error raised from the SQL is not caught and reported via Liquibase.

Where I noticed the problem is in a “sql” tag that selects a set of records, then iterates through the set of records and performs multiple inserts into several different tables during each iteration.  The initial SELECT completes successfully, but one of my INSERT statements had a hard-to-detect defect that raised an error on Test database that I was migrating.  There was no exception reported via Liquibase.

The second SQL statement doesn’t have to be an insert… A simple way to replicate the problem is to create a changeSet with the following tag:


Any ideas on how to work around this issue so an exception will be caught and reported? Or is this expected behavior?


It should generate an error correctly.  What do you get if you use the --logLevel=DEBUG flag?

It appears to be working correctly in trunk for the upcoming 2.0 release.