From 44b292a5ce7f376d9c92df9486a906cf210d1135 Mon Sep 17 00:00:00 2001 From: mkaruza Date: Mon, 16 Dec 2024 10:55:55 +0100 Subject: [PATCH] Read cache metadata correctly (#494) Currently we will not be able to read cache metadata for files that are bigger than 4GB because we use stoi function. Use stoll instead that will read long long values. Timestamp also needs to be read with stoll. --- src/pgduckdb_options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pgduckdb_options.cpp b/src/pgduckdb_options.cpp index 8d56e64b..bc4b81a3 100644 --- a/src/pgduckdb_options.cpp +++ b/src/pgduckdb_options.cpp @@ -264,8 +264,8 @@ DuckdbGetCachedFilesInfos() { p.path().c_str()); break; } - cache_info.push_back(CacheFileInfo {metadata_tokens[0], metadata_tokens[1], std::stoi(metadata_tokens[2]), - std::stoi(metadata_tokens[3])}); + cache_info.push_back(CacheFileInfo {metadata_tokens[0], metadata_tokens[1], std::stoll(metadata_tokens[2]), + std::stoll(metadata_tokens[3])}); } } return cache_info;