if ( isset( $noKeyOptions['DISTINCT'] ) && isset( $noKeyOptions['DISTINCTROW'] ) ) $startOpts .= 'DISTINCT';
# Various MySQL extensions
+ if ( isset( $noKeyOptions['STRAIGHT_JOIN'] ) ) $startOpts .= ' /*! STRAIGHT_JOIN */';
if ( isset( $noKeyOptions['HIGH_PRIORITY'] ) ) $startOpts .= ' HIGH_PRIORITY';
if ( isset( $noKeyOptions['SQL_BIG_RESULT'] ) ) $startOpts .= ' SQL_BIG_RESULT';
if ( isset( $noKeyOptions['SQL_BUFFER_RESULT'] ) ) $startOpts .= ' SQL_BUFFER_RESULT';
$this->addOption('ORDER BY', $field . ($isDirNewer ? '' : ' DESC'));
}
- protected function addOption($name, $value) {
- $this->options[$name] = $value;
+ protected function addOption($name, $value = null) {
+ if (is_null($value))
+ $this->options[] = $name;
+ else
+ $this->options[$name] = $value;
}
protected function select($method) {
$db = & $this->getDB();
extract($db->tableNames('logging', 'page', 'user'), EXTR_PREFIX_ALL, 'tbl');
+
+ $this->addOption('STRAIGHT_JOIN');
$this->addTables("$tbl_logging LEFT OUTER JOIN $tbl_page ON " .
"log_namespace=page_namespace AND log_title=page_title " .
"INNER JOIN $tbl_user ON user_id=log_user");