adrian
November 19, 2013, 4:40pm
1
Hi All, Ran the following command, but not sure how to pinpoint what is going wrong. Running against a local Mysql database. C:\Dev\liquibase-3.0.7-bin>liquibase --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://localhost:3306/kmmdemo --username=kmmdemo --password=kmmdemo --changeLogFile=output2.xml --diffTypes=data generateChangeLog --logLevel=DEBUGLiquibase generateChangeLog Failed: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 6 to TIMESTAMP. Anybody have idea on how I can figure out which table it has issue with? Thought maybe logLevel would give more info, but apparently not. Thanks Adrian
Are you getting any stacktrace in the debug output? Nathan
Guest
November 19, 2013, 4:40pm
3
Would the debug output also be generated in the command line? Or is it output to a file? Sorry I’m new to liquibase. Only got that oneliner in my console output.
Guest
November 19, 2013, 4:40pm
4
It should go to output. I think the problem is that the --logLevel=debug flag goes before the generateChangeLog command, not after.
Nathan
Yeah I moved the loglevel Following output now:
C:\Users\Carbon>liquibase --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://localhost:3306/kmmdemo --username=kmmdemo --password=kmmdemo --changeLogFile=output2.xml --logLevel=DEBUG --diffTypes=data generateChangeLog
DEBUG 11/21/13 8:37 AM:liquibase: Connected to kmmdemo@localhost@jdbc:mysql://localhost:3306/kmmdemo
DEBUG 11/21/13 8:37 AM:liquibase: Setting auto commit to false from true
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_catalog_item_live_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_customer_return_lines_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘sbval_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_stock_balance_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘qtytbl_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_awaiting_shipment_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_stock_reordered_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘reord_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_reorder_summary_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_checkin_correction_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_checkin_receivable_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_mass_maint_stock_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_stock_ordered_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘mm_vendor_return_lines_v’ and table_schema='kmmdemo’
DEBUG 11/21/13 8:38 AM:liquibase: Executing QUERY database command: select view_definition from information_schema.views where table_name=‘odett_v’ and table_schema='kmmdemo’
INFO 11/21/13 8:38 AM:liquibase: output2.xml exists, appending
DEBUG 11/21/13 8:38 AM:liquibase: MissingObjectChangeGenerator type order: liquibase.structure.core.Schema liquibase.structure.core.Table liquibase.structure.core.Data liquibase.structure.core.ForeignKey liquibase.structure.core.Index liquibase.structure.core.PrimaryKey liquibase.structure.core.View
Liquibase generateChangeLog Failed: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 6 to TIMESTAMP.
SEVERE 11/21/13 8:38 AM:liquibase: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 6 to TIMESTAMP.
liquibase.exception.UnexpectedLiquibaseException: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 6 to TIMESTAMP.
at liquibase.diff.output.changelog.core.MissingDataChangeGenerator.fixMissing(MissingDataChangeGenerator.java:206)
at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44)
at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:95)
at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:140)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:121)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:67)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:50)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:173)
at liquibase.integration.commandline.Main.doMigration(Main.java:791)
at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 6 to TIMESTAMP.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1339)
at com.mysql.jdbc.BufferRow.getTimestampFast(BufferRow.java:578)
at com.mysql.jdbc.ResultSetImpl.getTimestampInternal(ResultSetImpl.java:6754)
at com.mysql.jdbc.ResultSetImpl.getTimestamp(ResultSetImpl.java:6073)
at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5029)
at liquibase.util.JdbcUtils.getResultSetValue(JdbcUtils.java:83)
at liquibase.diff.output.changelog.core.MissingDataChangeGenerator.fixMissing(MissingDataChangeGenerator.java:180)
… 9 more
Caused by: java.sql.SQLException: Value ‘[B@4c272961’ can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)
at com.mysql.jdbc.ResultSetRow.getTimestampFast(ResultSetRow.java:1037)
… 15 more
For more information, use the --logLevel flag
Looks like we’re running into http://stackoverflow.com/questions/11133759/0000-00-00-000000-can-not-be-represented-as-java-sql-timestamp-error
Adding the parameter would get you past the error, but you will have to reset the correct zero date back. It looks like the problem is with rows with a zero timestamp value. Do you know how many rows that is in your database? Nathan