After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 120250 - KVP XML loader ignores '0' timestamps?
KVP XML loader ignores '0' timestamps?
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - XML
1.8.x
Other Linux
: Normal normal
: ---
Assigned To: Derek Atkins
Derek Atkins
Depends on:
Blocks:
 
 
Reported: 2003-08-19 14:07 UTC by Derek Atkins
Modified: 2018-06-29 20:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
KVP that failed (5.76 KB, text/plain)
2003-08-19 14:08 UTC, Derek Atkins
Details

Description Derek Atkins 2003-08-19 14:07:48 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)
Comment 1 Derek Atkins 2003-08-19 14:08:40 UTC
Created attachment 19346 [details]
KVP that failed
Comment 2 Chris Shoemaker 2006-03-17 15:38:50 UTC
Difference being:

KVP_VALUE_TIMESPEC(1969-12-31 22:33:11.1186607 -0500)

present in the first but absent in the second.
Comment 3 Christian Stimming 2006-09-04 11:42:09 UTC
Does this issue also occur in the 2.0.x versions?
Comment 4 Derek Atkins 2008-06-20 17:19:27 UTC
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.
Comment 5 Phil Longstaff 2009-05-29 21:29:17 UTC
The current svn tests pass and test-xml-transaction is used a few times.  Is there a specific test file which causes this failure?
Comment 6 Derek Atkins 2010-01-16 14:54:43 UTC
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)
Comment 7 John Ralls 2015-07-04 23:09:40 UTC
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.
Comment 8 John Ralls 2018-06-29 20:36:15 UTC
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.