From: Roan Kattouw Date: Sat, 10 May 2008 10:31:57 +0000 (+0000) Subject: Allow an array as ON clause. There are quite a few queries out there that JOIN on... X-Git-Tag: 1.31.0-rc.0~47747 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b47979916c2b8a5c39d74ff9257183f76673bbe7;p=lhc%2Fweb%2Fwiklou.git Allow an array as ON clause. There are quite a few queries out there that JOIN on title and namespace. --- diff --git a/includes/Database.php b/includes/Database.php index 3c27e66fc8..1df8571a09 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1466,7 +1466,7 @@ class Database { if ( isset($join_conds_safe[$table]) && isset($use_index_safe[$table]) ) { $tableClause = $join_conds_safe[$table][0] . ' ' . $this->tableName( $table ); $tableClause .= ' ' . $this->useIndexClause( implode( ',', (array)$use_index_safe[$table] ) ); - $tableClause .= ' ON (' . $join_conds_safe[$table][1] . ')'; + $tableClause .= ' ON (' . $this->makeList((array)$join_conds_safe[$table][1], LIST_AND) . ')'; $retJOIN[] = $tableClause; // Is there an INDEX clause? } else if ( isset($use_index_safe[$table]) ) { @@ -1476,7 +1476,7 @@ class Database { // Is there a JOIN clause? } else if ( isset($join_conds_safe[$table]) ) { $tableClause = $join_conds_safe[$table][0] . ' ' . $this->tableName( $table ); - $tableClause .= ' ON (' . $join_conds_safe[$table][1] . ')'; + $tableClause .= ' ON (' . $this->makeList((array)$join_conds_safe[$table][1], LIST_AND) . ')'; $retJOIN[] = $tableClause; } else { $tableClause = $this->tableName( $table );