gnucash maint: Correctly store time64 0 in the SQL backend.

John Ralls jralls at code.gnucash.org
Fri Jun 16 18:57:14 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/b5b0f603 (commit)
	from  https://github.com/Gnucash/gnucash/commit/5f8f9b9a (commit)



commit b5b0f60396f1eae56ccb8b9aa6975303d1072853
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Jun 16 15:57:52 2017 -0700

    Correctly store time64 0 in the SQL backend.
    
    The SQL backend ignored time64 0 when saving dates. time64 is a perfectly
    valid timestamp (1970-01-01 00:00:00) and should be stored.

diff --git a/src/backend/sql/gnc-backend-sql.c b/src/backend/sql/gnc-backend-sql.c
index 6140637..e9dfc75 100644
--- a/src/backend/sql/gnc-backend-sql.c
+++ b/src/backend/sql/gnc-backend-sql.c
@@ -1991,11 +1991,8 @@ add_gvalue_timespec_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
     value = g_new0( GValue, 1 );
     g_assert( value != NULL );
     (void)g_value_init( value, G_TYPE_STRING );
-    if ( ts.tv_sec != 0 || ts.tv_nsec != 0 )
-    {
-        datebuf = gnc_sql_convert_timespec_to_string( be, ts );
-        g_value_take_string( value, datebuf );
-    }
+    datebuf = gnc_sql_convert_timespec_to_string( be, ts );
+    g_value_take_string( value, datebuf );
 
     (*pList) = g_slist_append( (*pList), value );
 }



Summary of changes:
 src/backend/sql/gnc-backend-sql.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)



More information about the gnucash-changes mailing list