Closed enekofb closed 8 years ago
Merged your PR to fix your issue, although the JDBC interface states that CHAR_OCTET_LENGTH should return null for non char fields. We can revert if we see that it eventually breaks something else. Did the issue arise on a Date/Timestamp field only ?
Hi, Not only in Date, but it was primarily on the one that I have noticed it. With merge it is fixed (liquibase).
Hi Alexander, I am on the branch 3.0.3-spanshot which fixes the previous bug. However, I have found that that in MetadataResultSets: 170 there is the definition for charol as follows
and for those datatype that are not defined (i.e. JdbcDate), when trying to create column based on retrieved metadata, results in the following exception
Caused by: java.lang.NumberFormatException: For input string: "null" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_91] at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_91] at java.lang.Integer.valueOf(Integer.java:766) ~[na:1.8.0_91] at liquibase.snapshot.CachedRow.getInt(CachedRow.java:38) ~[liquibase-core-3.4.1.jar:na] at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readDataType(ColumnSnapshotGenerator.java:315) ~[liquibase-core-3.4.1.jar:na] at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readColumn(ColumnSnapshotGenerator.java:216) ~[liquibase-core-3.4.1.jar:na] at liquibase.snapshot.jvm.ColumnSnapshotGenerator.addTo(ColumnSnapshotGenerator.java:111) ~[liquibase-core-3.4.1.jar:na]
My workaround was just to set it up by default to max_value (is that wrong?) and it worked
Integer charol = Integer.MAX_VALUE;
Cheers,