From 42143e9cf3719630ab370e9369764cdaac892821 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 23 Mar 2021 21:39:45 +0300 Subject: =?UTF-8?q?fixes=20#2771=20(Implement=20mdbx=20=E2=86=92=20sqlite?= =?UTF-8?q?=20converter)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Dbx_mdbx/src/init.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/Dbx_mdbx') diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index 2741fe2341..cc9c47f265 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -74,9 +74,13 @@ static int grokHeader(const wchar_t *profile) return db->Check(); } -// returns 0 if all the APIs are injected otherwise, 1 +// returns a pointer to a database instance if all the APIs are injected, otherwise NULL static MDatabaseCommon* loadDatabase(const wchar_t *profile, BOOL bReadOnly) { + // if not read only, convert the old profile to SQLITE + if (!bReadOnly) + return DB::Upgrade(profile); + std::unique_ptr db(new CDbxMDBX(profile, (bReadOnly) ? DBMODE_READONLY : 0)); if (db->Map() != ERROR_SUCCESS) return nullptr; -- cgit v1.2.3