Bug 791848 - GC 2.6.x does not handle ISO dates introduced with GC 2.7.

Set a feature to prevent versions older that 2.6.20 from loading a
database from which they cannot read the dates. Ideally we would do this
only if the database is written to, but the current persistence design
includes committing back to the database during the load so the net
effect is that the flag would be set anyway.
This commit is contained in:
John Ralls
2017-12-23 14:27:04 -08:00
parent 91727525b9
commit bbd2df6a3b
3 changed files with 7 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ extern "C"
#include "gnc-engine.h"
#include "SX-book.h"
#include "Recurrence.h"
#include <gnc-features.h>
#include "gnc-uri-utils.h"
#include "gnc-filepath-utils.h"
#include <gnc-path.h>
@@ -76,6 +76,7 @@ extern "C"
#include <string>
#include <iomanip>
#include <qofsession.hpp>
#include <gnc-backend-prov.hpp>
#include "gnc-backend-dbi.h"
#include "gnc-backend-dbi.hpp"
@@ -470,7 +471,6 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
* Let's start logging */
xaccLogSetBaseName (filepath.c_str());
PINFO ("logpath=%s", filepath.c_str() ? filepath.c_str() : "(null)");
LEAVE ("");
}
@@ -830,6 +830,9 @@ GncDbiBackend<Type>::load (QofBook* book, QofBackendLoadType loadType)
GncSqlBackend::load(book, loadType);
if (Type == DbType::DBI_SQLITE)
gnc_features_set_used(book, GNC_FEATURE_SQLITE3_ISO_DATES);
if (GNUCASH_RESAVE_VERSION > get_table_version("Gnucash"))
{
/* The database was loaded with an older database schema or