Last modified: 2008-01-24 11:21:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12738 - Database query syntax error in maintenance/storage/
Database query syntax error in maintenance/storage/
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-01-22 16:20 UTC by Emil Podlaszewski
Modified: 2008-01-24 11:21 UTC (History)
1 user (show)

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


Description Emil Podlaszewski 2008-01-22 16:20:38 UTC
When running maintenance/storage/compressOld.php -t gzip this error occurs:

Starting from old_id 0...
A database query syntax error has occurred.
The last attempted database query was:
" SELECT  old_id,old_flags,old_namespace,old_title,old_text  FROM `text`  WHERE old_id>=0  ORDER BY old_id LIMIT 50   FOR UPDATE"
from within function "compressOldPages".
MySQL returned error "1054: Unknown column 'old_namespace' in 'field list' 

This is because table text has only three fields: old_id, old_text and old_flags. The following patch fixes it:

Index: maintenance/storage/
--- maintenance/storage/ (revision 30055)
+++ maintenance/storage/ (working copy)
@@ -15,7 +15,7 @@
        print "Starting from old_id $start...\n";
        $dbw = wfGetDB( DB_MASTER );
        do {
-               $res = $dbw->select( 'text', array( 'old_id','old_flags','old_namespace','old_title','old_text' ),
+               $res = $dbw->select( 'text', array( 'old_id','old_flags','old_text' ),
                        "old_id>=$start", $fname, array( 'ORDER BY' => 'old_id', 'LIMIT' => $chunksize, 'FOR UPDATE' ) );
                if( $dbw->numRows( $res ) == 0 ) {
Comment 1 Huji 2008-01-24 11:21:56 UTC
Fixed with r30110.

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