Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -245,6 +245,7 @@ |
246 | 246 | $values[$row2->nary_pos] = $dv; |
247 | 247 | } |
248 | 248 | } |
| 249 | + $db->freeResult($res2); |
249 | 250 | $res2 = $db->select( $db->tableName('smw_nary_longstrings'), |
250 | 251 | 'nary_pos, value_blob', |
251 | 252 | 'subject_id=' . $db->addQuotes($subject->getArticleID()) . |
— | — | @@ -257,6 +258,7 @@ |
258 | 259 | $values[$row2->nary_pos] = $dv; |
259 | 260 | } |
260 | 261 | } |
| 262 | + $db->freeResult($res2); |
261 | 263 | $res2 = $db->select( $db->tableName('smw_nary_relations'), |
262 | 264 | 'nary_pos, object_title, object_namespace', |
263 | 265 | 'subject_id=' . $db->addQuotes($subject->getArticleID()) . |
— | — | @@ -499,8 +501,6 @@ |
500 | 502 | array('subject_id' => $subject->getArticleID()), |
501 | 503 | 'SMW::deleteSubject::NAry'); |
502 | 504 | if ($db->affectedRows() != 0) { |
503 | | - ///FIXME: check there were entries in smw_nary before continuing! |
504 | | - /// "Affected rows" should be easy to get |
505 | 505 | $db->delete('smw_nary_relations', |
506 | 506 | array('subject_id' => $subject->getArticleID()), |
507 | 507 | 'SMW::deleteSubject::NAryRelations'); |
— | — | @@ -1292,7 +1292,7 @@ |
1293 | 1293 | } elseif ($tablename == 'REDIPAGE') { // +another copy of page for getting ids of redirect targets; *ouch* |
1294 | 1294 | if ($this->addJoin('REDIRECT', $from, $db, $curtables, $nary_pos)) { |
1295 | 1295 | $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 (' . |
1297 | 1297 | $curtables['REDIRECT'] . '.rd_title=' . $curtables['REDIPAGE'] . '.page_title AND ' . |
1298 | 1298 | $curtables['REDIRECT'] . '.rd_namespace=' . $curtables['REDIPAGE'] . '.page_namespace)'; |
1299 | 1299 | return $curtables['REDIPAGE']; |