This query is marked as a draft This query has been published by Cryptic.

SQL

x
 
-- query 1: identify problematic page
SET @cat = REPLACE('Candidates for speedy deletion as copyright violations', ' ', '_');
SELECT DISTINCT log_page, log_namespace, log_title
FROM logging_logindex
JOIN categorylinks ON cl_from = log_page
LEFT JOIN page ON page_id = log_page
JOIN archive ON ar_namespace = log_namespace AND ar_title = log_title AND ar_page_id = log_page -- this filters out redirects left by moves
WHERE cl_to = @cat
  AND page_id IS NULL;
-- queries 2-5: pre-fix status
SELECT * FROM category WHERE cat_title = @cat;
SELECT * FROM categorylinks WHERE cl_to = @cat;
SELECT * FROM page WHERE page_id = 72260446;
SELECT * FROM categorylinks WHERE cl_from = 72260446;
-- query 6: proper recount
SELECT COUNT(*)
FROM categorylinks
JOIN page ON page_id = cl_from -- missing from the recount caused by purging
WHERE cl_to = @cat;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.

Checking query status...