SQL
x
SELECT art.page_title,
REGEXP_REPLACE(art.page_title, '\\.+$', '') AS 'proposed redir',
CASE
WHEN (redir.page_is_redirect != 1 OR rd_namespace IS NULL) THEN 'exists, not a redir'
WHEN rd_namespace = 0 THEN CONCAT('exists, redir to ', rd_title)
ELSE CONCAT('exists, redir to {{ns:', rd_namespace, '}}:', rd_title)
END AS 'current status'
FROM page AS art
JOIN page AS redir
ON redir.page_namespace = 0
AND redir.page_title = REGEXP_REPLACE(art.page_title, '\\.+$', '')
LEFT JOIN redirect
ON rd_from = redir.page_id
WHERE art.page_namespace = 0
AND art.page_title LIKE '%.'
AND art.page_is_redirect = 0
AND (redir.page_is_redirect != 1
OR rd_namespace != 0
OR rd_title != art.page_title);
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.