# HG changeset patch # User Sebastien Jodogne # Date 1626275843 -7200 # Node ID 64763998cdff5d17fcd6904276995d89b2d1ace9 # Parent 8bb2eb006e21400f81d2cb435a6d0fbf9122aade clarification in IndexBackend::SignalDeletedFiles() diff -r 8bb2eb006e21 -r 64763998cdff Framework/Plugins/IndexBackend.cpp --- a/Framework/Plugins/IndexBackend.cpp Wed Jul 14 15:56:37 2021 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Wed Jul 14 17:17:23 2021 +0200 @@ -201,24 +201,21 @@ { DatabaseManager::CachedStatement statement( STATEMENT_FROM_HERE, manager, - "SELECT * FROM DeletedFiles"); + "SELECT uuid, fileType, uncompressedSize, uncompressedHash, compressionType, " + "compressedSize, compressedHash FROM DeletedFiles"); statement.SetReadOnly(true); statement.Execute(); while (!statement.IsDone()) { - std::string a = statement.ReadString(0); - std::string b = statement.ReadString(5); - std::string c = statement.ReadString(6); - - output.SignalDeletedAttachment(a.c_str(), + output.SignalDeletedAttachment(statement.ReadString(0), statement.ReadInteger32(1), - statement.ReadInteger64(3), - b.c_str(), + statement.ReadInteger64(2), + statement.ReadString(3), statement.ReadInteger32(4), - statement.ReadInteger64(2), - c.c_str()); + statement.ReadInteger64(5), + statement.ReadString(6)); statement.Next(); } diff -r 8bb2eb006e21 -r 64763998cdff Framework/Plugins/IndexUnitTests.h --- a/Framework/Plugins/IndexUnitTests.h Wed Jul 14 15:56:37 2021 +0200 +++ b/Framework/Plugins/IndexUnitTests.h Wed Jul 14 17:17:23 2021 +0200 @@ -675,6 +675,8 @@ a.compressedSize = 4242; a.compressedHash = "md5"; db.AddAttachment(*manager, resources[attachmentLevel], a, 42); + + ASSERT_THROW(db.AddAttachment(*manager, resources[attachmentLevel], a, 43), Orthanc::OrthancException); deletedAttachments.clear(); a.uuid = "attachment2";