SQL
AخA
WITH ns(ns_n, ns_s) AS (VALUES (-2, 'Media:'), (-1, 'Special:'), (0, ''), (1, 'Talk:'), (2, 'User:'), (3, 'User talk:'), (4,
'Wikipedia:'), (5, 'Wikipedia talk:'), (6, ':File:'), (7, 'File talk:'), (8, 'MediaWiki:'), (9, 'MediaWiki talk:'), (10, 'Template:'),
(11, 'Template talk:'), (12, 'Help:'), (13, 'Help talk:'), (14, ':Category:'), (15, 'Category talk:'), (100, 'Portal:'), (101,
'Portal talk:'), (118, 'Draft:'), (119, 'Draft talk:'), (710, 'TimedText:'), (711, 'TimedText talk:'), (828, 'Module:'), (829,
'Module talk:'), (2300, 'Gadget:'), (2301, 'Gadget talk:'), (2302, 'Gadget definition:'), (2303, 'Gadget definition talk:'))
SELECT CONCAT(COALESCE(ns_s, '?:'), REPLACE(log_title, '_', ' ')) AS title,
CONCAT('Special:Redirect/logid/', log_id) AS log,
REGEXP_REPLACE(log_params, '.*"associated_rev_id";i:([0-9]+);.*', 'Special:Diff/\\1') AS diff,
CAST(log_timestamp AS DATETIME) as timestamp,
EXISTS(SELECT 1 FROM page WHERE page_namespace = log_namespace AND page_title = log_title) AS 'title still exists',
EXISTS(SELECT 1 FROM page WHERE page_id = log_page) AS 'page still exists (anywhere)',
comment_text
FROM logging_userindex
JOIN actor_logging ON actor_id = log_actor
LEFT JOIN ns ON ns_n = log_namespace
LEFT JOIN comment_logging ON comment_id = log_comment_id
WHERE log_type = 'create'
AND actor_name = 'Pigsonthewing'
AND log_namespace NOT IN (2, 3);
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.