mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/11179] correct start param in author search of postgres
PHPBB3-11179
This commit is contained in:
parent
2cb48f0341
commit
ef88edbcf6
1 changed files with 19 additions and 0 deletions
|
@ -583,6 +583,11 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
|
||||||
$author_name,
|
$author_name,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
if ($start < 0)
|
||||||
|
{
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// try reading the results from cache
|
// try reading the results from cache
|
||||||
$result_count = 0;
|
$result_count = 0;
|
||||||
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
|
if ($this->obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir) == SEARCH_RESULT_IN_CACHE)
|
||||||
|
@ -725,6 +730,20 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
|
||||||
|
|
||||||
$this->db->sql_transaction('commit');
|
$this->db->sql_transaction('commit');
|
||||||
|
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
$id_ary[] = (int) $row[$field];
|
||||||
|
}
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$id_ary = array_unique($id_ary);
|
||||||
|
|
||||||
if (sizeof($id_ary))
|
if (sizeof($id_ary))
|
||||||
{
|
{
|
||||||
$this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
$this->save_ids($search_key, '', $author_ary, $result_count, $id_ary, $start, $sort_dir);
|
||||||
|
|
Loading…
Add table
Reference in a new issue