r85669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85668‎ | r85669 | r85670 >
Date:12:45, 8 April 2011
Author:freakolowsky
Status:resolved (Comments)
Tags:
Comment:
* r81084 added prefix to index name and as this index gets synced directly it has to use the same prefix
Modified paths:
  • /trunk/phase3/includes/search/SearchOracle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchOracle.php
@@ -238,6 +238,7 @@
239239 * @param $text String
240240 */
241241 function update($id, $title, $text) {
 242+ global $wgDBprefix;
242243 $dbw = wfGetDB(DB_MASTER);
243244 $dbw->replace('searchindex',
244245 array('si_page'),
@@ -253,9 +254,9 @@
254255 // ALTER SESSION SET CURRENT_SCHEMA = ...
255256 // was used.
256257 $dbw->query( "CALL ctx_ddl.sync_index(" .
257 - $dbw->addQuotes( $dbw->getDBname() . '.si_text_idx' ) . ")" );
 258+ $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_text_idx' ) . ")" );
258259 $dbw->query( "CALL ctx_ddl.sync_index(" .
259 - $dbw->addQuotes( $dbw->getDBname() . '.si_title_idx' ) . ")" );
 260+ $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_title_idx' ) . ")" );
260261 }
261262
262263 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r85670* partial merge of r81084 (installer and search was broken)...freakolowsky13:25, 8 April 2011
r85786* fix as per brion's comment on r85669freakolowsky13:50, 11 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81084* Fixed Oracle new installer support, broken by r80957. This is a minimal pat...tstarling08:25, 27 January 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   21:21, 8 April 2011

Rather than using the $wgDBprefix global, you should use $dbw->tableName('si_text_idx') etc to get the full table name. This will be more consistent with other code that constructs manual SQL, and avoids accidentally using the wrong prefix if there's a complex setup with different prefixes on different connections (eek!)

Status & tagging log