r85786 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85785‎ | r85786 | r85787 >
Date:13:50, 11 April 2011
Author:freakolowsky
Status:resolved (Comments)
Tags:
Comment:
* fix as per brion's comment on r85669
Modified paths:
  • /trunk/phase3/includes/search/SearchOracle.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchOracle.php
@@ -254,9 +254,9 @@
255255 // ALTER SESSION SET CURRENT_SCHEMA = ...
256256 // was used.
257257 $dbw->query( "CALL ctx_ddl.sync_index(" .
258 - $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_text_idx' ) . ")" );
 258+ $dbw->addQuotes( $dbw->getDBname() . '.' . trim( $dbw->tableName( 'si_text_idx' ), '"' ) ) . ")" );
259259 $dbw->query( "CALL ctx_ddl.sync_index(" .
260 - $dbw->addQuotes( $dbw->getDBname() . '.'.$wgDBprefix.'si_title_idx' ) . ")" );
 260+ $dbw->addQuotes( $dbw->getDBname() . '.' . trim( $dbw->tableName( 'si_title_idx' ), '"' ) ) . ")" );
261261 }
262262
263263 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r85788* 1.17 MFT r85786freakolowsky13:53, 11 April 2011
r85920$wgDBprefix shall be converted to uppercase per r85786platonides20:56, 12 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85669* r81084 added prefix to index name and as this index gets synced directly it...freakolowsky12:45, 8 April 2011

Comments

#Comment by Platonides (talk | contribs)   15:15, 12 April 2011

What if $wgDBprefix contained some character that needs quoting?

I think tableName() should have a parameter to not quote the resulting variable (ie. it needs to be passed to addIdentifierQuotes before usage).

#Comment by MaxSem (talk | contribs)   15:18, 12 April 2011

Why trim tableName?

#Comment by Platonides (talk | contribs)   19:03, 12 April 2011

The parameter added to tableName() in r85888 should remove the quotes for you if needed. I think they should be there, though. Also test with the addIdentifierQuotes() change.

#Comment by Freakolowsky (talk | contribs)   20:50, 12 April 2011

The current state of MW oracle abstraction doesn't support quoted naming, because that makes object names case sensitive and not all of the code is currently written to work that way. So currently $wgDBprefix (and all other parts of object names) *should not* contain characters that need quoting.

I'll add the parameter and use it in this case.

#Comment by Platonides (talk | contribs)   20:57, 12 April 2011

Seems that it's the other code what should be fixed. I uppercased $wgDBprefix for you in r85920.

#Comment by Freakolowsky (talk | contribs)   10:49, 15 April 2011

used quoted parameter in r86112

Status & tagging log