Page MenuHomePhabricator

Updater calls PopulateLogSearch before adding logging.log_user_text; populateLogUsertext not called
Closed, ResolvedPublic

Description

The PopulateLogSearch updater function in maintenance/populateLogSearch.php is called when doing database updates for 1.16, as defined by the following code in getCoreUpdateList() from includes/installer/MysqlUpdater.php

// 1.16
array( 'addTable', 'user_properties', 'patch-user_properties.sql' ),
array( 'addTable', 'log_search', 'patch-log_search.sql' ),
array( 'doLogSearchPopulation' ),
array( 'addField', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
....

Unfortunately the updater function relies on the presence of the field log_user_text in logging, which is added *after* the log search population. This causes updates to fail with a database error due to selects on the missing field (on MySQL 5.5.9, FreeBSD 8.1, MW 1.17 branch, updating a 1.15 database).

Switching the addField around so it is above the doLogSearchPopulation appeared to resolve this issue - the update proceeded, at least, though I'm not sure it had the right information since it just added that field.

The code in populateLogSearch.php was added in r56312 for bug 18472
...
// Add item author relations...
$userIds = $userIPs = array();
$sres = $db->select( 'logging',
array( 'log_user', 'log_user_text' ),
array( 'log_id' => $items )
...

On a related note, populateLogUsertext.php does not appear to be called. Deliberate? (The description at the top of the file also seems inaccurate.)


Version: unspecified
Severity: major

Details

Reference
bz27518

Event Timeline

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