From e565b0cb4f5f3bcdf6bcb361fef44d5cd8e05a8b Mon Sep 17 00:00:00 2001 From: Graham Date: Fri, 12 Feb 2021 00:02:06 +0000 Subject: [PATCH] Tighten JOIN conditions in importMasterIndexAndGetIndexes The conditions are now consistent with the master_index_valid_indexes view. Signed-off-by: Graham --- .../main/kotlin/org/openrs2/archive/cache/CacheImporter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt index f74fc961..f572b98f 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt @@ -214,8 +214,10 @@ public class CacheImporter @Inject constructor( FROM master_index_archives a LEFT JOIN master_index_archives a2 ON a2.master_index_id = ? AND a2.archive_id = a.archive_id AND a2.crc32 = a.crc32 AND a2.version = a.version - LEFT JOIN containers c ON c.crc32 = a2.crc32 - LEFT JOIN indexes i ON i.version = a2.version AND i.container_id = c.id + LEFT JOIN groups g ON g.archive_id = 255 AND g.group_id = a2.archive_id::INTEGER AND + g.version = a2.version AND NOT g.version_truncated + LEFT JOIN containers c ON c.id = g.container_id AND c.crc32 = a2.crc32 + LEFT JOIN indexes i ON i.container_id = g.container_id AND i.version = a2.version WHERE a.master_index_id = ? ORDER BY a.archive_id ASC """.trimIndent()