r5261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5260‎ | r5261 | r5262 >
Date:12:34, 17 September 2004
Author:midom
Status:old
Tags:
Comment:
REPLACE INTO -> Database::replace(), getting ready for tsearch
Modified paths:
  • /trunk/phase3/includes/SearchUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SearchUpdate.php
@@ -105,11 +105,12 @@
106106 # Strip wiki '' and '''
107107 $text = preg_replace( "/''[']*/", " ", $text );
108108 wfProfileOut( "$fname-regexps" );
109 -
110 - $sql = "REPLACE INTO $searchindex (si_page,si_title,si_text) VALUES ({$this->mId},'" .
111 - $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "','" .
112 - $db->strencode( $text ) . "')";
113 - $db->query( $sql, 'SearchUpdate::doUpdate' );
 109+ $db->replace( $searchindex, array(array('si_page')),
 110+ array(
 111+ 'si_page' => $this->mId,
 112+ 'si_title' => $db->strencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ),
 113+ 'si_text' => $db->strencode( $text )
 114+ ), 'SearchUpdate::doUpdate' );
114115 wfProfileOut( $fname );
115116 }
116117 }

Status & tagging log