From b71b145494bcf553c0fce7d91a5f77c19c0a613c Mon Sep 17 00:00:00 2001 From: ziyi chen Date: Sun, 19 Nov 2023 14:22:31 -0500 Subject: [PATCH] Storage version --- src/storage/storage_info.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_info.cpp b/src/storage/storage_info.cpp index fe7559862d6..d78241d9b53 100644 --- a/src/storage/storage_info.cpp +++ b/src/storage/storage_info.cpp @@ -11,9 +11,14 @@ namespace storage { storage_version_t StorageVersionInfo::getStorageVersion() { auto storageVersionInfo = getStorageVersionInfo(); if (!storageVersionInfo.contains(KUZU_STORAGE_VERSION)) { + // If the current KUZU_STORAGE_VERSION is not in the map, + // then we must run the newest version of kuzu // LCOV_EXCL_START - throw RuntimeException( - stringFormat("Invalid storage version name: {}", KUZU_STORAGE_VERSION)); + storage_version_t maxVersion = 0; + for (auto& [_, versionNumber] : storageVersionInfo) { + maxVersion = std::max(maxVersion, versionNumber); + } + return maxVersion; // LCOV_EXCL_STOP } return storageVersionInfo.at(KUZU_STORAGE_VERSION);