From b78bbf651821abc4e6f858b298d305b8573f8429 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 10 Jan 2025 13:56:54 +0000 Subject: [PATCH] Move to new linktarget table Since Mediawiki 1.38, page links targets are stored in a new `linktarget` table instead of the original `pagelinks` table. Details: - https://www.mediawiki.org/wiki/Manual:Linktarget_table - https://www.mediawiki.org/wiki/Manual:Pagelinks_table This commit modifies the query on pagelinks to retrieve link target title from the new table instead of the former one. This is a bit quick and dirty because this is not supposed to be used in the long term since this tool is supposed to be decommissioned / replaced by a Python alternative. --- build_selections.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_selections.sh b/build_selections.sh index c9fbe47..ed4993e 100755 --- a/build_selections.sh +++ b/build_selections.sh @@ -194,7 +194,7 @@ do UPPER_LIMIT=$((UPPER_LIMIT + 10000)) echo " from pl_from from $LOWER_LIMIT to $UPPER_LIMIT..." $MYSQL \ - "SELECT pl_from, pl_title FROM pagelinks WHERE pl_namespace = 0 AND pl_from_namespace = 0 AND pl_from >= $LOWER_LIMIT AND pl_from < $UPPER_LIMIT" \ + "SELECT pl_from, lt_title AS pl_title FROM pagelinks LEFT JOIN linktarget ON pl_target_id = lt_id WHERE lt_namespace = 0 AND pl_from_namespace = 0 AND pl_from >= $LOWER_LIMIT AND pl_from < $UPPER_LIMIT" \ -N -h ${DB_HOST} ${DB} >> $PAGELINKS NEW_SIZE=$(ls -la $PAGELINKS 2> /dev/null | cut -d " " -f5) done