Currently a query like the following is generated:
SELECT user_table.userID
FROM wcf1_user user_table
LEFT JOIN wcf1_user_option_value option_value
ON (option_value.userID = user_table.userID)WHERE option_value.userOption4 = ?
This works due to the parentheses around the `ON` part of the `JOIN`, but it
certainly is not pretty and it will cause issues if the parentheses are removed
(as it happened for WoltLab Suite 5.4).
Insert a newline between the base query and the condition to fix the issue.
Resolves #4078
Co-Authored-By: mutec <mysterycode@mysterycode.de>
}
// do search
- $statement = WCF::getDB()->prepareStatement($sql.$this->conditions, $this->maxResults);
+ $statement = WCF::getDB()->prepareStatement($sql."\n".$this->conditions, $this->maxResults);
$statement->execute($this->conditions->getParameters());
$this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
}