From 1e0d680c78bb1238e6cc5af477ac5ad0f6154712 Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Tue, 7 Nov 2023 17:53:02 -0500 Subject: [PATCH] Fix issue with incorrect `database_size` when requesting a smaller `shared_file_size` --- src/pinnable_mapped_file.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pinnable_mapped_file.cpp b/src/pinnable_mapped_file.cpp index 3875da2..e3d16a2 100644 --- a/src/pinnable_mapped_file.cpp +++ b/src/pinnable_mapped_file.cpp @@ -134,7 +134,8 @@ pinnable_mapped_file::pinnable_mapped_file(const std::filesystem::path& dir, boo std::filesystem::resize_file(_data_file_path, shared_file_size); } else if(shared_file_size < existing_file_size) { - std::cerr << "CHAINBASE: \"" << _database_name << "\" requested size of " << shared_file_size << " is less than " + _database_size = existing_file_size; + std::cerr << "CHAINBASE: \"" << _database_name << "\" requested size of " << shared_file_size << " is less than " "existing size of " << existing_file_size << ". This database will not be shrunk and will " "remain at " << existing_file_size << '\n'; }