Drizzle JDBC Driver support w/ MySQL

I’ve found that if I use the Drizzle JDBC driver with MySQL liquibase fails.  It generally works fine in that I can apply my change log, but on subsequent runs it can not find the DATABASECHANGELOG table.  I have narrowed it down to the following stack trace.  What it appears to be doing is that it finds the table and then when running the logic to see if the table found matches the table desired the Schema objects don’t match.  One schema object have the values {catalog=def, name=def, objects={}} and the other Schema object has the value {catalog=null, objects={}}.  In the end the names don’t match.

I’m guessing this is an issue with the Drizzle driver not returning something properly.  Is there anything that can be done.  I would really like to use the Drizzle driver because of the BSD.  For all other practical purposes the driver is working fine for me.

Here’s the stack trace to where its failing.

DefaultDatabaseObjectComparator.nameMatches(DatabaseObject, DatabaseObject, Database) line: 90   
DefaultDatabaseObjectComparator.isSameObject(DatabaseObject, DatabaseObject, Database, DatabaseObjectComparatorChain) line: 34   
DatabaseObjectComparatorChain.isSameObject(DatabaseObject, DatabaseObject, Database) line: 43   
SchemaComparator.isSameObject(DatabaseObject, DatabaseObject, Database, DatabaseObjectComparatorChain) line: 30   
DatabaseObjectComparatorChain.isSameObject(DatabaseObject, DatabaseObject, Database) line: 43   
DatabaseObjectComparatorFactory.isSameObject(DatabaseObject, DatabaseObject, Database) line: 129   
TableComparator.isSameObject(DatabaseObject, DatabaseObject, Database, DatabaseObjectComparatorChain) line: 39   
DatabaseObjectComparatorChain.isSameObject(DatabaseObject, DatabaseObject, Database) line: 43   
DatabaseObjectComparatorFactory.isSameObject(DatabaseObject, DatabaseObject, Database) line: 129   
DatabaseObjectCollection.get(DatabaseObjectType) line: 71   
JdbcDatabaseSnapshot(DatabaseSnapshot).get(DatabaseObjectType) line: 188   
SnapshotGeneratorFactory.createSnapshot(T, Database, SnapshotControl) line: 134   
SnapshotGeneratorFactory.has(DatabaseObject, Database) line: 90   
SnapshotGeneratorFactory.hasDatabaseChangeLogLockTable(Database) line: 165   
MySQLDatabase(AbstractJdbcDatabase).hasDatabaseChangeLogLockTable() line: 865   
MySQLDatabase(AbstractJdbcDatabase).checkDatabaseChangeLogLockTable() line: 928   
LockServiceImpl.acquireLock() line: 114   
LockServiceImpl.waitForLock() line: 80   
Liquibase.update(Contexts) line: 170   
Liquibase.update(String) line: 162   
Loader(SpringLiquibase).performUpdate(Liquibase) line: 332   
Loader(SpringLiquibase).afterPropertiesSet() line: 299   
Loader.afterPropertiesSet() line: 27   

Thanks,
Darren  


The stacktrace doesn’t include the exception message. Also what version of liquibase are you running?

Nathan

I’m running liquibase off of a random point on master, 29708e5fce12a4bc0d0f88625e7976dae7cdeb50.  I can rebase to the latest if that would be helpful.  That stacktrace is not actually of an exception.  That is the point in the code where it finds that the Schema objects don’t match.  The actual exception you see is below.  Basically it thinks the change log table doesn’t exist and goes and tries to create it again.  I’m running drizzle jdbc 1.2 against MySQL 5.5 (packaged in Ubuntu 13.10).

Caused by: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE core_changelog (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, DESCRIPTION VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL): Table ‘core_changelog’ already exists
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:103)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:66)
    at liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogTable(AbstractJdbcDatabase.java:807)
    at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:697)
    at liquibase.Liquibase.update(Liquibase.java:178)
    at liquibase.Liquibase.update(Liquibase.java:162)
    at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:332)
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:299)

Darren

I didn’t realize 3.1 was just released, I just updated to 3.1 with the same result.

Darren

Looking a bit more at the code, apparently Drizzle JDBC driver will always return null for the catalog.  But when liquibase queries the MySQL information schema it finds the table catalog to be “def.”  Not sure what can be done here.  Is there any special case that be added for Drizzle?  Again, it would really help out me if this could work just due to licensing restrictions.

Darren