Page MenuHomePhabricator

maintenance/updateSearchIndex.php gives Error: 1100 Table 'intranet_user' was not locked with LOCK TABLES (localhost)
Closed, ResolvedPublic

Description

Author: orion

Description:
On one of my media wiki instances I when running maintenance/updateSearchIndex.php I would get:

A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_deleted,rev_len,rev_parent_id,rev_sha1,page_namespace,page_title,page_id,page_latest,user_name FROM intranet_revision INNER JOIN intranet_page ON ((page_id = rev_page)) LEFT JOIN intranet_user ON ((rev_user != 0) AND (user_id = rev_user)) WHERE rev_page = '280' AND page_id = '280' AND (rev_id=page_latest) LIMIT 1
Function: Revision::fetchFromConds
Error: 1100 Table 'intranet_user' was not locked with LOCK TABLES (localhost)

I fixed this by also locking the user table for reading:

  • /usr/share/mediawiki119/maintenance/Maintenance.php.orig 2012-09-17 10:55:30.903679871 -0600

+++ /usr/share/mediawiki119/maintenance/Maintenance.php 2012-09-17 10:51:40.341680145 -0600
@@ -1084,7 +1084,7 @@

 */
private function lockSearchindex( &$db ) {
        $write = array( 'searchindex' );
  • $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache' );

+ $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user' );

        $db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ );
}

Version: 1.19.2
Severity: normal

Details

Reference
bz40302

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz40302.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Sep 17 2012, 5:04 PM

orion wrote:

This didn't make it into 1.19.3. Any chance this can make it into the 1.19.X branch?

The same thing with user_properties unde MW 1.28.