r85670 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85669‎ | r85670 | r85671 >
Date:13:25, 8 April 2011
Author:freakolowsky
Status:ok (Comments)
Tags:
Comment:
* partial merge of r81084 (installer and search was broken)
* merge of r85669 search index prefix while syncing
Modified paths:
  • /branches/REL1_17/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /branches/REL1_17/phase3/includes/search/SearchOracle.php (modified) (history)
  • /branches/REL1_17/phase3/maintenance/oracle/tables.sql (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/maintenance/oracle/tables.sql
@@ -610,8 +610,8 @@
611611 --);
612612 --CREATE UNIQUE INDEX &mw_prefix.profiling_u01 ON &mw_prefix.profiling (pf_name, pf_server);
613613
614 -CREATE INDEX si_title_idx ON &mw_prefix.searchindex(si_title) INDEXTYPE IS ctxsys.context;
615 -CREATE INDEX si_text_idx ON &mw_prefix.searchindex(si_text) INDEXTYPE IS ctxsys.context;
 614+CREATE INDEX &mw_prefix.si_title_idx ON &mw_prefix.searchindex(si_title) INDEXTYPE IS ctxsys.context;
 615+CREATE INDEX &mw_prefix.si_text_idx ON &mw_prefix.searchindex(si_text) INDEXTYPE IS ctxsys.context;
616616
617617 CREATE TABLE &mw_prefix.l10n_cache (
618618 lc_lang varchar2(32) NOT NULL,
Index: branches/REL1_17/phase3/includes/search/SearchOracle.php
@@ -246,8 +246,16 @@
247247 'si_title' => $title,
248248 'si_text' => $text
249249 ), 'SearchOracle::update' );
250 - $dbw->query("CALL ctx_ddl.sync_index('si_text_idx')");
251 - $dbw->query("CALL ctx_ddl.sync_index('si_title_idx')");
 250+
 251+ // Sync the index
 252+ // We need to specify the DB name (i.e. user/schema) here so that
 253+ // it can work from the installer, where
 254+ // ALTER SESSION SET CURRENT_SCHEMA = ...
 255+ // was used.
 256+ $dbw->query( "CALL ctx_ddl.sync_index(" .
 257+ $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_text_idx' ) . ")" );
 258+ $dbw->query( "CALL ctx_ddl.sync_index(" .
 259+ $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_title_idx' ) . ")" );
252260 }
253261
254262 /**
Index: branches/REL1_17/phase3/includes/db/DatabaseOracle.php
@@ -1083,10 +1083,16 @@
10841084 }
10851085
10861086 function selectDB( $db ) {
1087 - if ( $db == null || $db == $this->mUser ) { return true; }
 1087+ $this->mDBname = $db;
 1088+ if ( $db == null || $db == $this->mUser ) {
 1089+ return true;
 1090+ }
10881091 $sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper($db);
10891092 $stmt = oci_parse( $this->mConn, $sql );
1090 - if ( !oci_execute( $stmt ) ) {
 1093+ wfSuppressWarnings();
 1094+ $success = oci_execute( $stmt );
 1095+ wfRestoreWarnings();
 1096+ if ( !$success ) {
10911097 $e = oci_error( $stmt );
10921098 if ( $e['code'] != '1435' ) {
10931099 $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );

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
r85669* r81084 added prefix to index name and as this index gets synced directly it...freakolowsky12:45, 8 April 2011

Comments

#Comment by Freakolowsky (talk | contribs)   13:27, 8 April 2011

had to do this partial merge ... because r8104 was not merged installer and search were broken in this branch

Status & tagging log