r18424 - gnucash/trunk/src - Fix bug 593581 - 2.3.5: Save to MySQL still fails with date error

Phil Longstaff plongstaff at code.gnucash.org
Thu Nov 19 20:20:48 EST 2009


Author: plongstaff
Date: 2009-11-19 20:20:47 -0500 (Thu, 19 Nov 2009)
New Revision: 18424
Trac: http://svn.gnucash.org/trac/changeset/18424

Modified:
   gnucash/trunk/src/backend/sql/gnc-backend-sql.c
   gnucash/trunk/src/backend/sql/gnc-transaction-sql.c
   gnucash/trunk/src/business/business-core/sql/gnc-entry-sql.c
   gnucash/trunk/src/business/business-core/sql/gnc-invoice-sql.c
Log:
Fix bug 593581 -  2.3.5: Save to MySQL still fails with date error

After the change storing date-time values as a TIMESTAMP, a Timespec value of 0 could be stored in
mysql (I'm in EST timezone) because it converted to "19700101000000" which is "19700101050000" UTC
which is in the valid TIMESTAMP range of >= "19700101000001".  However, someone in UTC couldn't
store that value because it is treated as in the local timezone, and for someone in UK, it is out of
range.

This change changes 0 Timespec values to NULL db values.  Slots already allow NULL TIMESPEC values.
There are a few places where the db schema needs to be changed to allow NULL values.




More information about the gnucash-patches mailing list