[LB2-b3] changelog file with condition and sequence definition on MySQL


Trying the Liquibase B3 (from subversion, revision 1157) I have the following problem. The changelog includes a changeset to create a sequence on Oracle and is marked with a pre-condition which checks the database type. When the file is executed against a MySQL database and the SQL is not executed but printed on screen, liquibase crashes on the createSequence tag.

This is the changelog

    <?xml version="1.0" encoding="UTF-8" standalone="no"?> http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">


And this is the program executing liquibase:

    // package and imports

    public class App {

        public static void main(String[] args) throws Exception {
            App a = new App();

        public void run() throws Exception {
            OracleTypeConverter otc = new OracleTypeConverter();

            Connection con = getMysqlConnection(“jdbc:mysql://localhost:3306/ht_empty”, “test”, “test”);
            Liquibase liquibase = new Liquibase(“C:\temp\changelog_with_generator.xml”, new FileSystemResourceAccessor(), new JdbcConnection(con));

    	// store the SQL in a String

            StringWriter sw = new StringWriter();

            try {
                liquibase.update(null, sw);
            } catch (Exception e) {

        private Connection getMysqlConnection(String url, String username, String password) {
            try {
                Connection con = DriverManager.getConnection(url, username, password);
                return con;
            } catch (SQLException ex) {
            } catch (ClassNotFoundException ex) {
            return null;


When the SQL is executed on the database no exceptions are thrown. The change set is marked_ran as expected in the databasechangelog table.




Seems like the same issue as " is not supported by sql file generation" but in my situation it leads to an error because the target database does not support sequences.


Thanks for the kick.  It got pushed too far down in my stack…

You are right, it is the same issue.  I think the logic needs to be improved around the updateSQL logic and supports sequences or not.  I am going to add a “runOnGenerateSql” flag or something similar to preconditions for 2.0 to help with this sort of issue.