Skip to content

Commit

Permalink
Storage version
Browse files Browse the repository at this point in the history
  • Loading branch information
acquamarin committed Nov 19, 2023
1 parent 8f9f38e commit b71b145
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/storage/storage_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b71b145

Please sign in to comment.