[ticket/11179] fix success query path for postgres

Additional query to check start parameter executed only incase of no
results.

PHPBB3-11179
This commit is contained in:
Dhruv 2012-12-02 14:31:12 +05:30
parent f0d63594e6
commit 8b7f306897

View file

@ -521,7 +521,6 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
if ($start >= $result_count)
{
$start = floor(($result_count - 1) / $per_page) * $per_page;
}
$result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
@ -532,6 +531,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
$this->db->sql_freeresult($result);
$id_ary = array_unique($id_ary);
}
// store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page
$this->save_ids($search_key, implode(' ', $this->split_words), $author_ary, $result_count, $id_ary, $start, $sort_dir);
@ -733,7 +733,6 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
if ($start >= $result_count)
{
$start = floor(($result_count - 1) / $per_page) * $per_page;
}
$result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
while ($row = $this->db->sql_fetchrow($result))
@ -743,6 +742,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
$this->db->sql_freeresult($result);
$id_ary = array_unique($id_ary);
}
if (sizeof($id_ary))
{