Skip to content

Commit

Permalink
Fix issue #107
Browse files Browse the repository at this point in the history
Method `wxSQLite3Database::ConvertJournalMode(const wxString& mode)` checked the journal mode string against upper case values. This failed, because `PRAGMA journal_mode` returns the journal mode in lower case. The comparison is now done case insensitive.
  • Loading branch information
utelle committed Nov 1, 2022
1 parent 3bc12d0 commit 534e38a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/wxsqlite3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3500,13 +3500,13 @@ wxString wxSQLite3Database::ConvertJournalMode(wxSQLite3JournalMode mode)
wxSQLite3JournalMode wxSQLite3Database::ConvertJournalMode(const wxString& mode)
{
wxSQLite3JournalMode journalMode;
if (mode.IsSameAs(wxS("DELETE"))) journalMode = WXSQLITE_JOURNALMODE_DELETE;
else if (mode.IsSameAs(wxS("PERSIST"))) journalMode = WXSQLITE_JOURNALMODE_PERSIST;
else if (mode.IsSameAs(wxS("OFF"))) journalMode = WXSQLITE_JOURNALMODE_OFF;
else if (mode.IsSameAs(wxS("TRUNCATE"))) journalMode = WXSQLITE_JOURNALMODE_TRUNCATE;
else if (mode.IsSameAs(wxS("MEMORY"))) journalMode = WXSQLITE_JOURNALMODE_MEMORY;
else if (mode.IsSameAs(wxS("WAL"))) journalMode = WXSQLITE_JOURNALMODE_WAL;
else journalMode = WXSQLITE_JOURNALMODE_DELETE;
if (mode.IsSameAs(wxS("DELETE"), false)) journalMode = WXSQLITE_JOURNALMODE_DELETE;
else if (mode.IsSameAs(wxS("PERSIST"), false)) journalMode = WXSQLITE_JOURNALMODE_PERSIST;
else if (mode.IsSameAs(wxS("OFF"), false)) journalMode = WXSQLITE_JOURNALMODE_OFF;
else if (mode.IsSameAs(wxS("TRUNCATE"), false)) journalMode = WXSQLITE_JOURNALMODE_TRUNCATE;
else if (mode.IsSameAs(wxS("MEMORY"), false)) journalMode = WXSQLITE_JOURNALMODE_MEMORY;
else if (mode.IsSameAs(wxS("WAL"), false)) journalMode = WXSQLITE_JOURNALMODE_WAL;
else journalMode = WXSQLITE_JOURNALMODE_DELETE;
return journalMode;
}

Expand Down

0 comments on commit 534e38a

Please sign in to comment.