diff options
| author | Dhruv <dhruv.goel92@gmail.com> | 2012-12-02 14:31:12 +0530 |
|---|---|---|
| committer | Dhruv <dhruv.goel92@gmail.com> | 2013-02-19 00:52:52 +0530 |
| commit | 8b7f306897cddcb16cbed50488848ee357c26f39 (patch) | |
| tree | 9e39117ba74639421ed688fcce0b9fc762ffdb74 /phpBB/includes | |
| parent | f0d63594e68fa7a165b8ba90d0fcf35f38e42de9 (diff) | |
| download | forums-8b7f306897cddcb16cbed50488848ee357c26f39.tar forums-8b7f306897cddcb16cbed50488848ee357c26f39.tar.gz forums-8b7f306897cddcb16cbed50488848ee357c26f39.tar.bz2 forums-8b7f306897cddcb16cbed50488848ee357c26f39.tar.xz forums-8b7f306897cddcb16cbed50488848ee357c26f39.zip | |
[ticket/11179] fix success query path for postgres
Additional query to check start parameter executed only incase of no
results.
PHPBB3-11179
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/search/fulltext_postgres.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index bdc2fa4f19..eeb628b18f 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -521,17 +521,17 @@ 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); + $result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start); - while ($row = $this->db->sql_fetchrow($result)) - { - $id_ary[] = $row[$field]; - } - $this->db->sql_freeresult($result); + while ($row = $this->db->sql_fetchrow($result)) + { + $id_ary[] = $row[$field]; + } + $this->db->sql_freeresult($result); - $id_ary = array_unique($id_ary); + $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,16 +733,16 @@ 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)) - { - $id_ary[] = (int) $row[$field]; - } - $this->db->sql_freeresult($result); + $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); + $id_ary = array_unique($id_ary); + } if (sizeof($id_ary)) { |
