r24238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24237‎ | r24238 | r24239 >
Date:12:13, 18 July 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Fixed join (left join required instead of inner join)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php
@@ -245,6 +245,7 @@
246246 $values[$row2->nary_pos] = $dv;
247247 }
248248 }
 249+ $db->freeResult($res2);
249250 $res2 = $db->select( $db->tableName('smw_nary_longstrings'),
250251 'nary_pos, value_blob',
251252 'subject_id=' . $db->addQuotes($subject->getArticleID()) .
@@ -257,6 +258,7 @@
258259 $values[$row2->nary_pos] = $dv;
259260 }
260261 }
 262+ $db->freeResult($res2);
261263 $res2 = $db->select( $db->tableName('smw_nary_relations'),
262264 'nary_pos, object_title, object_namespace',
263265 'subject_id=' . $db->addQuotes($subject->getArticleID()) .
@@ -499,8 +501,6 @@
500502 array('subject_id' => $subject->getArticleID()),
501503 'SMW::deleteSubject::NAry');
502504 if ($db->affectedRows() != 0) {
503 - ///FIXME: check there were entries in smw_nary before continuing!
504 - /// "Affected rows" should be easy to get
505505 $db->delete('smw_nary_relations',
506506 array('subject_id' => $subject->getArticleID()),
507507 'SMW::deleteSubject::NAryRelations');
@@ -1292,7 +1292,7 @@
12931293 } elseif ($tablename == 'REDIPAGE') { // +another copy of page for getting ids of redirect targets; *ouch*
12941294 if ($this->addJoin('REDIRECT', $from, $db, $curtables, $nary_pos)) {
12951295 $curtables['REDIPAGE'] = 'rp' . SMWSQLStore::$m_tablenum++;
1296 - $from .= ' INNER JOIN ' . $db->tableName('page') . ' AS ' . $curtables['REDIPAGE'] . ' ON (' .
 1296+ $from .= ' LEFT JOIN ' . $db->tableName('page') . ' AS ' . $curtables['REDIPAGE'] . ' ON (' .
12971297 $curtables['REDIRECT'] . '.rd_title=' . $curtables['REDIPAGE'] . '.page_title AND ' .
12981298 $curtables['REDIRECT'] . '.rd_namespace=' . $curtables['REDIPAGE'] . '.page_namespace)';
12991299 return $curtables['REDIPAGE'];

Status & tagging log