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

       Web browser: ---
            Bug ID: 60499
           Summary: migrateOversightRevisions.php doesn't work with table
                    aliases
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Oversight
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: s...@reedyboy.net
                CC: br...@wikimedia.org, kren...@gmail.com,
                    wikimedia.b...@snowolf.eu
    Classification: Unclassified
   Mobile Platform: ---

I use table prefixes on my dev wiki for this specific reason

reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core/extensionsgit/Oversight$
php migrateToRevDel.php
Migrating oversighted revisions to suppressed revisions. This will not add
anything to recentchanges.
A database query error has occurred.
Query: SELECT  hidden_page as page_id,hidden_namespace as
page_namespace,hidden_title as page_title,hidden_page as
rev_page,hidden_comment as rev_comment,hidden_user as rev_user,hidden_user_text
as rev_user_text,hidden_timestamp as rev_timestamp,hidden_minor_edit as
rev_minor_edit,hidden_deleted as rev_deleted,hidden_rev_id as
rev_id,hidden_text_id as rev_text_id,0 as
rev_len,hidden_by_user,hidden_on_timestamp,hidden_reason,user_name,0 as
page_is_new,0 as rc_id,1 as rc_patrolled,0 as rc_old_len,0 as rc_new_len,0 as
rc_params,NULL AS rc_log_action,0 AS rc_deleted,0 AS rc_logid,NULL AS
rc_log_type,NULL AS rev_parent_id,hidden.*  FROM `mw_hidden` INNER JOIN
`mw_user` ON ((user.user_id = hidden.hidden_by_user))  WHERE
(hidden.hidden_rev_id > '-1')  ORDER BY hidden_rev_id LIMIT 20
Function: MigrateOversightRevisions::execute
Error: 1051 Unknown table 'hidden' (192.168.0.212)




            $hiddenRows = $dbw->select(
                array( 'hidden', 'user' ),
                $selectFields,
                array( 'hidden.hidden_rev_id > ' . $dbw->addQuotes( $lastRevId
) ),
                __METHOD__,
                array( 'LIMIT' => $this->mBatchSize, 'ORDER BY' =>
'hidden_rev_id' ),
                array( 'user' => array( 'INNER JOIN', 'user.user_id =
hidden.hidden_by_user' ) )
            );


There's at least 2 usages there (maybe more in the whole file) of
tablename.col, that does break for hidden and user queries


Simplest fix might be to just alias the tables when selecting the tables

-- 
You are receiving this mail because:
You are the assignee for the bug.
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