upgraded bundled SQLite to 3.8.7.1;

fixed #590: Poco::Data::SQlite doesn't support URI filenames
This commit is contained in:
Guenter Obiltschnig
2014-11-07 11:12:04 +01:00
parent fa4989e0c7
commit e95b6dea87
4 changed files with 6476 additions and 3661 deletions

View File

@@ -29,6 +29,11 @@
#endif
#ifndef SQLITE_OPEN_URI
#define SQLITE_OPEN_URI 0
#endif
namespace Poco {
namespace Data {
namespace SQLite {
@@ -55,6 +60,7 @@ const std::string Utility::SQLITE_TIME_FORMAT = "%H:%M:%S";
Utility::TypeMap Utility::_types;
Poco::Mutex Utility::_mutex;
Utility::Utility()
{
Poco::Mutex::ScopedLock l(_mutex);
@@ -217,7 +223,7 @@ bool Utility::fileToMemory(sqlite3* pInMemory, const std::string& fileName)
sqlite3* pFile;
sqlite3_backup* pBackup;
rc = sqlite3_open(fileName.c_str(), &pFile);
rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READONLY | SQLITE_OPEN_URI, NULL);
if(rc == SQLITE_OK )
{
pBackup = sqlite3_backup_init(pInMemory, "main", pFile, "main");
@@ -240,7 +246,7 @@ bool Utility::memoryToFile(const std::string& fileName, sqlite3* pInMemory)
sqlite3* pFile;
sqlite3_backup* pBackup;
rc = sqlite3_open(fileName.c_str(), &pFile);
rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI, NULL);
if(rc == SQLITE_OK )
{
pBackup = sqlite3_backup_init(pFile, "main", pInMemory, "main");
@@ -306,6 +312,4 @@ void* Utility::eventHookRegister(sqlite3* pDB, RollbackCallbackType callbackFn,
}
} } } // namespace Poco::Data::SQLite