| 32 | } |
| 33 | |
| 34 | static void validateMagicBytes(common::Deserializer& deSer) { |
| 35 | std::string key; |
| 36 | deSer.validateDebuggingInfo(key, "magic"); |
| 37 | const auto numMagicBytes = strlen(StorageVersionInfo::MAGIC_BYTES); |
| 38 | uint8_t magicBytes[4]; |
| 39 | for (auto i = 0u; i < numMagicBytes; i++) { |
| 40 | deSer.deserializeValue<uint8_t>(magicBytes[i]); |
| 41 | } |
| 42 | if (memcmp(magicBytes, StorageVersionInfo::MAGIC_BYTES, numMagicBytes) != 0) { |
| 43 | throw common::RuntimeException( |
| 44 | "Unable to open database. The file is not a valid Lbug database file!"); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void DatabaseHeader::updateCatalogPageRange(PageManager& pageManager, PageRange newPageRange) { |
| 49 | if (catalogPageRange.startPageIdx != common::INVALID_PAGE_IDX) { |
no test coverage detected