Last modified: 2014-01-27 22:52:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T62499, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60499 - migrateOversightRevisions.php doesn't work with table aliases
migrateOversightRevisions.php doesn't work with table aliases
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Oversight (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-27 21:49 UTC by Sam Reed (reedy)
Modified: 2014-01-27 22:52 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2014-01-27 21:49:13 UTC
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
Comment 1 Gerrit Notification Bot 2014-01-27 22:13:35 UTC
Change 109765 had a related patch set uploaded by Reedy:
Use table prefixes in migrateToRevDel.php

https://gerrit.wikimedia.org/r/109765
Comment 2 Gerrit Notification Bot 2014-01-27 22:19:42 UTC
Change 109767 had a related patch set uploaded by Reedy:
Use table prefixes in migrateToRevDel.php

https://gerrit.wikimedia.org/r/109767
Comment 3 Gerrit Notification Bot 2014-01-27 22:32:35 UTC
Change 109765 abandoned by Reedy:
Use table prefixes in migrateToRevDel.php

https://gerrit.wikimedia.org/r/109765
Comment 4 Gerrit Notification Bot 2014-01-27 22:33:50 UTC
Change 109767 merged by Alex Monk:
Use table prefixes in migrateToRevDel.php

https://gerrit.wikimedia.org/r/109767
Comment 5 Alex Monk 2014-01-27 22:52:54 UTC
Should be fixed

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links