View Issue Details

IDProjectCategoryView StatusLast Update
0004065SymmetricDSImprovementpublic2019-08-08 09:00
ReporterelongAssigned Toelong 
Prioritynormal 
Status resolvedResolutionfixed 
Product Version3.9.0 
Target Version3.10.4Fixed in Version3.10.4 
Summary0004065: Allow zero date on MySQL or convert to null otherwise (3.10)
DescriptionAdd a database info property for "zero date allowed" and default it to false. Only MySQL appears to allow a zero date, so that platform will set the property to true. For other databases, convert the zero date to a null so the row can load. Since the conversion will happen during loading, the user still has the option of configuring a transform to handle zero dates in another way.

Some background info: the Java conversion of a string 0000-00-00 00:00:00 to timestamp object fails because there is no year 0 on the calendar. There is a second operation on failure where tries again and it's able to format the date, but returns the closest valid date of 0002-11-30. By setting the parameter of db.treat.date.time.as.varchar.enabled=true for a MySQL node, the zero date can be loaded because no conversion is done in Java. Also, the db.url parameter needs modified to remove the zeroDateTimeBehavior=convertToNull URL parameter -- that parameter only affects queries and initial load, while triggers capture zero dates regardless.
TagsNo tags attached.

Relationships

related to 0004064 resolvedelong Allow zero date on MySQL or convert to null otherwise 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.10 ffa2568b

2019-08-08 08:33:44

admin

Details Diff
0004065: Allow zero date on MySQL or convert to null otherwise (3.10)
0004065
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/AbstractDatabasePlatform.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/DatabaseInfo.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/mysql/MySqlDdlBuilder.java Diff File

Issue History

Date Modified Username Field Change
2019-08-08 08:36 elong New Issue
2019-08-08 08:36 elong Status new => assigned
2019-08-08 08:36 elong Assigned To => elong
2019-08-08 08:36 elong Issue generated from: 0004064
2019-08-08 08:36 elong Relationship added related to 0004064
2019-08-08 08:57 elong Status assigned => resolved
2019-08-08 08:57 elong Resolution open => fixed
2019-08-08 08:57 elong Fixed in Version => 3.10.4
2019-08-08 09:00 admin Changeset attached => SymmetricDS 3.10 ffa2568b