https://bugzilla.wikimedia.org/show_bug.cgi?id=18121
Summary: deleteArchivedRevisions.php deletes even without its --
delete option
Product: MediaWiki
Version: 1.15-svn
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Normal
Component: Maintenance scripts
AssignedTo: [email protected]
ReportedBy: [email protected]
Here --help makes it seems that --delete is needed to actually delete.
But surprise surprise, it deletes even without --delete.
$ php deleteArchivedRevisions.php --help
Delete Archived Revisions
Deletes all archived revisions.
These revisions will no longer be restorable.
Usage: php deleteArchivedRevisions.php [--delete|--help]
delete : Performs the deletion
help : Show this usage information
$ mysqlshow --count taizhongbus|egrep 'T| archive'
| Tables | Columns | Total Rows |
| archive | 15 | 2206 |
$ php deleteArchivedRevisions.php
Delete Archived Revisions
Deleting archived revisions...done.
$ mysqlshow --count taizhongbus|egrep 'T| archive'
| Tables | Columns | Total Rows |
| archive | 15 | 0 |
The same thing happens if one does used --delete or not.
It seems --delete is ignored completely, and instead used here:
$delete = $dbw->affectedRows() != 0;
But looking at
/usr/share/doc/php-doc/html/function.mysql-affected-rows.html:
"Get the number of affected rows by the last INSERT, UPDATE, REPLACE or
DELETE query..."
Which does not include TRUNCATE.
So it seems that
if( $delete ) {
PurgeRedundantText( true );
}
will never fire at all.
So the archive table will get truncated every time, --delete or not.
But PurgeRedundantText() will never get run, --delete or not.
So the only table ever affected is the archive table.
The text table is never touched.
So it does damage even with the safety pin still in place, and even without, it
never hits its real target.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- 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
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l