Bug #68489 Error synchronizing model with table having rows with date set to 0000-00-00 00:
Submitted: 25 Feb 2013 20:14 Modified: 26 May 2013 17:07
Reporter: Artur Stępień Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.44 revision 9933, 5.2.47 revision 10398 OS:Windows (Windows 7 x64)
Assigned to: CPU Architecture:Any
Tags: SQL_MODE, synchronization

[25 Feb 2013 20:14] Artur Stępień
Description:
Almost every table in that system has 1-3 not null rows with default value set to 0000-00-00 00:00:00
System works fine, but when i try to synchronize model with table containing data with such rows
Workbench returns this error:

Executing SQL script in server

ERROR: Error 1292: Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time' at row 1

Funny is that Workbench have SQL_MODE set to TRADITIONAL,ALLOW_INVALID_DATES
in (Menu "Workbench Preferences/Model: MySQL/Forward Engineering and Synchronization/SQL_MODE to be used in generated scripts")
So it shouldn't generate such problems. In Forward Engineering everything works fine, but when I try synchronizing that error occurs. It looks like SQL_MODE setting was ignored.

How to repeat:
Now synchronize model with database.

Or just Reverse Engineer any Joomla database containing data (like articles), edit model and synchronize with database
[25 Feb 2013 20:43] MySQL Verification Team
Please provide your project modl file (private if you wish). Thanks.
[28 Feb 2013 14:42] Artur Stępień
Latest build is also affected. What I did found is that that error is because SQL_MODE in Preferences (default SQL_MODE) is set to: TRADITIONAL,ALLOW_INVALID_DATES

When it is set like this. Server will reject update. Removing TRADITIONAL helps.
Also, in new Workbench version there is per connection SQL_MODE but it is ignored. Whatever is set there it is not used in queries (Instead default SQL_MODE is used). It also should be fixed in future release.
[26 Mar 2013 16:52] Armando Lopez Valencia
Thanks a lot for your report.
Verified in:
Windows 7x64
WB 5.2.47
Only one SQLMODE value is accepted.
[26 May 2013 17:07] Alfredo Kojima
Duplicate of bug #59868