From 9419e5fe90738aab66a6f3707c2692eafd7c2b04 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Thu, 7 Jun 2001 02:39:27 +0000 Subject: [PATCH] bug fix git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4499 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/sql/PostgresBackend.c | 8 +++++++- src/engine/sql/kvp-sql.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/sql/PostgresBackend.c b/src/engine/sql/PostgresBackend.c index b0cf21482c..ebbedcd967 100644 --- a/src/engine/sql/PostgresBackend.c +++ b/src/engine/sql/PostgresBackend.c @@ -702,7 +702,13 @@ pgendStoreTransactionNoLock (PGBackend *be, Transaction *trans, p = guid_to_string_buff (xaccSplitGetGUID(s), p); p = stpcpy (p, "';\n"); } - pgendStoreAuditTransaction (be, trans, SQL_DELETE); + + /* If this trans is marked for deletetion, use the 'orig' values + * as the base for recording the audit. This wouldn't be normally + * reqquired, except that otherwise one gets a trashed currency + * value. + */ + pgendStoreAuditTransaction (be, trans->orig, SQL_DELETE); p = be->buff; p = stpcpy (p, "DELETE FROM gncTransaction WHERE transGuid='"); p = guid_to_string_buff (xaccTransGetGUID(trans), p); diff --git a/src/engine/sql/kvp-sql.c b/src/engine/sql/kvp-sql.c index 76ea2eeb0b..904bbeb97f 100644 --- a/src/engine/sql/kvp-sql.c +++ b/src/engine/sql/kvp-sql.c @@ -545,7 +545,7 @@ pgendKVPDeleteStr (PGBackend *be, const char *guid) iguid = pgendGetGUIDCacheIDStr (be, guid); if (0 == iguid) return; - sprintf (iguid_str, "%d;", iguid); + sprintf (iguid_str, "%d;\n", iguid); guid_to_string_buff (be->sessionGuid, sess_str); /* first, copy values to the audit tables */