From f53c9c120c50a952c38fabbf118295eae613661c Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Tue, 8 Feb 2022 15:40:37 +0300 Subject: [PATCH] Postfixes for #7122: Invalid state of mapping cache after replacement of database --- src/jrd/Mapping.cpp | 4 ++-- src/jrd/Mapping.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jrd/Mapping.cpp b/src/jrd/Mapping.cpp index 9bda5f4a37..e65a876158 100644 --- a/src/jrd/Mapping.cpp +++ b/src/jrd/Mapping.cpp @@ -1235,10 +1235,10 @@ InitInstance spCache; void resetMap(const char* db, ULONG index) { - if(index & Mapping::MAPPING_CACHE) + if (index & Mapping::MAPPING_CACHE) resetMap(db); - if(index & Mapping::SYSTEM_PRIVILEGES_CACHE) + if (index & Mapping::SYSTEM_PRIVILEGES_CACHE) spCache().invalidate(db); } diff --git a/src/jrd/Mapping.h b/src/jrd/Mapping.h index b7ac46ea8d..5ff436676e 100644 --- a/src/jrd/Mapping.h +++ b/src/jrd/Mapping.h @@ -79,7 +79,7 @@ public: // possible clearCache() flags static const USHORT MAPPING_CACHE = 0x01; static const USHORT SYSTEM_PRIVILEGES_CACHE = 0x02; - static const USHORT ALL_CACHE = ~0u; + static const USHORT ALL_CACHE = MAX_USHORT; // Helper statuc functions to perform cleanup & shutdown. static void clearCache(const char* dbName, USHORT id); static void shutdownIpc();