From 375b92cf80d59bc98459a19e034c4afd5b42cee7 Mon Sep 17 00:00:00 2001 From: Takuhiro Hizume Date: Sat, 27 Jan 2024 20:29:34 +0900 Subject: [PATCH] Fix Rebuild so that it sets the file size correctly --- LiteDB/Engine/Engine/Rebuild.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiteDB/Engine/Engine/Rebuild.cs b/LiteDB/Engine/Engine/Rebuild.cs index 959205fc3..a5c9b580b 100644 --- a/LiteDB/Engine/Engine/Rebuild.cs +++ b/LiteDB/Engine/Engine/Rebuild.cs @@ -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);