Bug 789594 - Unable to overwrite sqlite3 database file

This commit is contained in:
Geert Janssens 2018-07-05 22:29:16 +02:00
parent 240c4bd2cf
commit 9ab06bc9b3

View File

@ -403,13 +403,18 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
return;
}
if (create && !force && file_exists)
if (create && file_exists)
{
set_error (ERR_BACKEND_STORE_EXISTS);
auto msg = "Might clobber, no force";
PWARN ("%s", msg);
LEAVE("Error");
return;
if (!force)
{
set_error (ERR_BACKEND_STORE_EXISTS);
auto msg = "Might clobber, no force";
PWARN ("%s", msg);
LEAVE("Error");
return;
}
else
g_unlink (filepath.c_str());
}
connect(nullptr);