https://bugzilla.wikimedia.org/show_bug.cgi?id=59336

--- Comment #3 from Bugzilla Bug Importer (valhallasw) 
<wmf.bugconver...@gmail.com> ---
-------------------------------------------------------------------------------
From: merl <mewikipe...@to.mabomuja.de>
Date: Sun, 20 Dec 2009 17:28:27
-------------------------------------------------------------------------------

I extended the original query so that links to file namespace are filted out if
there is an page on commons. (e.g. File:Sura1.pdf)

    #! /bin/sh
    #$ -N DBQ-82
    #$ -m e
    #$ -hard
    #$ -l sqlprocs-s3=1
    SQL="SELECT CONCAT('#
[[:{{subst:ns:',pl_namespace,'}}',if(pl_namespace,':',''),REPLACE(pl_title,'_','
'),']] ',"
    SQL="$SQL  '([[{{subst:#special:WhatLinksHere}}/',REPLACE(pl_title,'_','
'),'|',COUNT(*),' Links]])') AS value"
    SQL="$SQL FROM pagelinks"
    SQL="$SQL  LEFT JOIN page AS pg1 ON pl_namespace = pg1.page_namespace AND
pl_title = pg1.page_title"
    SQL="$SQL  LEFT JOIN commonswiki_p.page AS pgc ON pl_namespace =
pgc.page_namespace AND pl_title = pgc.page_title AND pgc.page_namespace=6"
    SQL="$SQL  LEFT JOIN page AS pg2 ON pl_from = pg2.page_id"
    SQL="$SQL WHERE pg1.page_namespace IS NULL AND pgc.page_namespace IS NULL"
    SQL="$SQL  AND pl_namespace NOT IN (2,3)"
    SQL="$SQL  AND pg2.page_namespace != 8"
    SQL="$SQL GROUP BY pl_namespace, pl_title"
    SQL="$SQL HAVING COUNT(*) > 1"
    SQL="$SQL ORDER BY COUNT(*) DESC"
    mysql -wBN -harwikisource-p.db arwikisource_p -e "$SQL" > DBQ-82.txt

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to