Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/VisualStudio/XSharpCodeModelXs/Database/XDatabase.prg
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,12 @@ STATIC METHOD SetPragmas(oConn AS DbConnection) AS VOID
Log("Set the pragmas for the database")
USING VAR oCmd := CreateCommand("PRAGMA foreign_keys = ON", oConn)
oCmd:ExecuteNonQuery()
// Register the collation before the VACUUM: the VACUUM rebuilds the NOCASE indexes with the collation
// that is registered at that moment. With the built-in NOCASE the indexes no longer match the custom
// NOCASE of Microsoft.Data.Sqlite, lookups miss rows and SQLite reports "database disk image is malformed".
oConn:SetCollation()
oCmd:CommandText := "VACUUM"
oCmd:ExecuteNonQuery()
oConn:SetCollation()
CATCH e AS Exception
Log("Error setting pragmas")
XSettings.Exception(e)
Expand Down