#3135: Poco::Data::SQLite::Utility::fileToMemory unsuccessful if journal exists

This commit is contained in:
Günter Obiltschnig
2021-06-15 15:02:45 +02:00
parent f107834d08
commit bfb03fe765

View File

@@ -248,7 +248,9 @@ bool Utility::fileToMemory(sqlite3* pInMemory, const std::string& fileName)
sqlite3* pFile;
sqlite3_backup* pBackup;
rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READONLY | SQLITE_OPEN_URI, NULL);
// Note: SQLITE_OPEN_READWRITE is required to correctly handle an existing hot journal.
// See #3135
rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_URI, NULL);
if(rc == SQLITE_OK )
{
pBackup = sqlite3_backup_init(pInMemory, "main", pFile, "main");