gnucash maint: Bug 796369 - Notes lost or perhaps just not displaying when using...

John Ralls jralls at code.gnucash.org
Fri May 25 16:04:26 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/243bf8af (commit)
	from  https://github.com/Gnucash/gnucash/commit/5708707f (commit)



commit 243bf8afce7b19dcb1bc869f708ad5c99bd53275
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri May 25 12:58:39 2018 -0700

    Bug 796369 - Notes lost or perhaps just not displaying when using...
    
    SQLite backend.
    
    Release Note: This bug caused data loss if you saved your SQLite3
    database to a different file or database.
    
    The problem is that in SQLite3 (though not in MySQL or PgSQL) the
    subquery ((SELECT DISTINCT guid FROM transactions)) (note the double
    parentheses) returns only the first guid in the subquery's results.
    
    Some transactions are loaded by special queries and those queries are
    also used to retrieve the transaction's slots so they weren't affected.

diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp
index 1627183..f2e2b1f 100644
--- a/libgnucash/backend/sql/gnc-transaction-sql.cpp
+++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp
@@ -391,8 +391,8 @@ query_transactions (GncSqlBackend* sql_be, std::string selector)
 
         if (selector.empty())
         {
-            selector = "(SELECT DISTINCT ";
-            selector += tpkey + " FROM " TRANSACTION_TABLE ")";
+            selector = "SELECT DISTINCT ";
+            selector += tpkey + " FROM " TRANSACTION_TABLE;
         }
         gnc_sql_slots_load_for_sql_subquery (sql_be, selector,
 					     (BookLookupFn)xaccTransLookup);



Summary of changes:
 libgnucash/backend/sql/gnc-transaction-sql.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list