Last modified: 2008-01-24 11:21:56 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 T14738, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12738 - Database query syntax error in maintenance/storage/compressOld.inc
Database query syntax error in maintenance/storage/compressOld.inc
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.12.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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/compressOld.inc
===================================================================
--- maintenance/storage/compressOld.inc (revision 30055)
+++ maintenance/storage/compressOld.inc (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 ) {
                        break;
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.


Navigation
Links