Page MenuHomePhabricator

Database query syntax error in maintenance/storage/compressOld.inc
Closed, ResolvedPublic

Description

Author: emil

Description:
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;

Version: 1.12.x
Severity: minor

Details

Reference
bz12738

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:01 PM
bzimport set Reference to bz12738.
bzimport added a subscriber: Unknown Object (MLST).