mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
Merge pull request #4449 from DavidIQ/ticket/14782
[ticket/14782] Don't use 'DISTINCT' when using 'SQL_CALC_FOUND_ROWS'
This commit is contained in:
commit
33584f12f0
@ -1262,7 +1262,7 @@ class fulltext_native extends \phpbb\search\base
|
||||
if (!$total_results && $is_mysql)
|
||||
{
|
||||
// Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
|
||||
$sql_calc = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS ' . $select, $sql);
|
||||
$sql_calc = str_replace('SELECT ' . $select, 'SELECT SQL_CALC_FOUND_ROWS ' . $select, $sql);
|
||||
|
||||
$result = $this->db->sql_query($sql_calc);
|
||||
$this->db->sql_freeresult($result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user