Skip to content

Commit

Permalink
Merge pull request #2413 from hizume/fix-rebuild
Browse files Browse the repository at this point in the history
Fix Rebuild so that it truncates the database file correctly
  • Loading branch information
mbdavid authored Jan 29, 2024
2 parents 262415a + 375b92c commit aff0bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LiteDB/Engine/Engine/Rebuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public long Rebuild(RebuildOptions options)
_disk.Write(new[] { _header.UpdateBuffer() }, FileOrigin.Data);

// set new fileLength
_disk.SetLength((_header.LastPageID + 1) * PAGE_SIZE, FileOrigin.Data);
_disk.SetLength((long)(_header.LastPageID + 1) * PAGE_SIZE, FileOrigin.Data);

// get new filelength to compare
var newLength = _disk.GetVirtualLength(FileOrigin.Data);
Expand Down

0 comments on commit aff0bd8

Please sign in to comment.