GNOME Bugzilla – Bug 120250
KVP XML loader ignores '0' timestamps?
Last modified: 2018-06-29 20:36:15 UTC
Warning: xaccTransEqual: splits b936ac357a67fa0e9197c597aded156b and b936ac357a67fa0e9197c597aded156b differ FAILURE gnc_transaction_sixtp_parser_create ../../../../../src/backend/file/test/test-xml-transaction.c:324 5 FAIL: test-xml-transaction (see attached file)
Created attachment 19346 [details] KVP that failed
Difference being: KVP_VALUE_TIMESPEC(1969-12-31 22:33:11.1186607 -0500) present in the first but absent in the second.
Does this issue also occur in the 2.0.x versions?
I need to look into this again. I'm fairly sure this hasn't been corrected but I haven't tested recently. I'll get to it in my copious spare time.
The current svn tests pass and test-xml-transaction is used a few times. Is there a specific test file which causes this failure?
Phil, see comment #1 for the failed KVP test... Oh, looks like it's not in the database anymore. Phooey. Umm... I think you can force the issue by creating a KVP_VALUE_TIMESPEC(1969-12-31 22:33:11.1186607 -0500)
This is apparently intentional: src/backends/xml/sixtp-dom-parsers.cpp: static KvpValue* dom_tree_to_timespec_kvp_value (xmlNodePtr node) { Timespec ts; KvpValue * ret = NULL; ts = dom_tree_to_timespec (node); if (ts.tv_sec || ts.tv_nsec) { ret = new KvpValue{ts}; } return ret; } However, src/backends/sql/gnc-slots-sql.cpp: static void set_timespec_val( gpointer pObject, Timespec ts ) { slot_info_t* pInfo = (slot_info_t*)pObject; KvpValue *value = NULL; g_return_if_fail( pObject != NULL ); if ( pInfo->value_type != KvpValue::Type::TIMESPEC ) return; value = new KvpValue{ts}; set_slot_from_value( pInfo, value ); } Considering that our date system covers 1 Jan 1400 - 31 Dec 9999, surely treating the exact Unix Epoch as special is dumb. Fixed in kvp-cleanup, merging to master soon.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=120250. Please update any external references or bookmarks.