From 28a94ed60b26c0ab7957c3f013edd99c080dafa0 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 23 Jun 2024 21:12:08 -0400 Subject: [PATCH] Fix "Orphaned article deletion discussions" report by joining linktarget --- dbreps2/src/enwiki/orphanedafds.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dbreps2/src/enwiki/orphanedafds.rs b/dbreps2/src/enwiki/orphanedafds.rs index bad2b740..c2ec71e8 100644 --- a/dbreps2/src/enwiki/orphanedafds.rs +++ b/dbreps2/src/enwiki/orphanedafds.rs @@ -51,10 +51,9 @@ FROM page JOIN revision ON page_id = rev_page LEFT JOIN pagelinks ON pl_title = page_title - AND pl_namespace = page_namespace - /* FIXME JOIN linktarget */ + JOIN linktarget AS lt1 ON lt1.lt_id = pl_target_id AND lt1.lt_namespace = 4 LEFT JOIN templatelinks ON tl_title = page_title - AND tl_namespace = page_namespace + JOIN linktarget AS lt2 ON lt2.lt_id = tl_target_id AND lt2.lt_namespace = 4 WHERE page_namespace = 4 AND page_is_redirect = 0