Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -885,10 +885,10 @@ |
886 | 886 | $from .= ' INNER JOIN ' . $db->tableName('smw_longstrings') . ' AS ' . $curtables['TEXT'] . ' ON ' . $curtables['TEXT'] . '.subject_id=' . $curtables['PAGE'] . '.page_id'; |
887 | 887 | return true; |
888 | 888 | } |
889 | | - } elseif ($tablename == 'REDIRECT') { |
| 889 | + } elseif ($tablename == 'REDIRECT') { |
890 | 890 | if ($this->addInnerJoin('PAGE', $from, $db, $curtables)) { // try to add PAGE |
891 | 891 | $curtables['REDIRECT'] = 'rd' . $this->m_tablenum++; |
892 | | - $from .= ' INNER JOIN ' . $db->tableName('redirect') . ' AS ' . $curtables['REDIRECT'] . ' ON ' . $curtables['REDIRECT'] . '.rd_from=' . $curtables['PAGE'] . '.page_id'; |
| 892 | + $from .= ' INNER JOIN ' . $db->tableName('redirect') . ' AS ' . $curtables['REDIRECT']; |
893 | 893 | return true; |
894 | 894 | } |
895 | 895 | } |
— | — | @@ -949,15 +949,13 @@ |
950 | 950 | $db->addQuotes($page->getDBKey()) . ' AND ' . |
951 | 951 | $curtables['PREVREL'] . '.object_namespace=' . |
952 | 952 | $page->getNamespace(); |
953 | | - if ( $smwgIQRedirectNormalization && ($this->addInnerJoin('PAGE', $from, $db, $curtables)) ) { |
954 | | - $rdtable = 'rd' . $this->m_tablenum++; |
955 | | - $from .= ' INNER JOIN ' . $db->tableName('redirect') . ' AS ' . $rdtable; |
| 953 | + if ( $smwgIQRedirectNormalization && ($this->addInnerJoin('REDIRECT', $from, $db, $curtables)) ) { |
956 | 954 | $cond = '(' . $cond . ') OR (' . |
957 | | - $rdtable . '.rd_from=' . |
| 955 | + $curtables['REDIRECT'] . '.rd_from=' . |
958 | 956 | $curtables['PAGE'] . '.page_id AND ' . |
959 | | - $rdtable . '.rd_title=' . |
| 957 | + $curtables['REDIRECT'] . '.rd_title=' . |
960 | 958 | $db->addQuotes($page->getDBKey()) . ' AND ' . |
961 | | - $rdtable . '.rd_namespace=' . |
| 959 | + $curtables['REDIRECT'] . '.rd_namespace=' . |
962 | 960 | $page->getNamespace() . ')'; |
963 | 961 | } |
964 | 962 | $where .= $cond; |