From d1a49e01cef336a44700134dc35abc88a485da94 Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Sun, 10 Jun 2012 17:11:30 +0530 Subject: [PATCH] [feature/postgresql-fulltext-search] remove backward compatibility removes backward compatibility before PostgreSQL ver 8.3 if version is before 8.3 displays error. PHPBB3-9730 --- phpBB/includes/search/fulltext_postgres.php | 44 +++------------------ 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index ad39d16818..893c87549a 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -60,12 +60,6 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base { $this->tsearch_builtin = true; } - - - if (!$this->tsearch_builtin) - { - $db->sql_query("SELECT set_curcfg('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "')"); - } } $error = false; @@ -95,19 +89,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base if (!$this->tsearch_builtin) { - $sql = "SELECT c.relname - FROM pg_catalog.pg_class c - WHERE c.relkind = 'r' - AND c.relname = 'pg_ts_cfg' - AND pg_catalog.pg_table_is_visible(c.oid)"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (empty ($row['relname'])) - { - return $user->lang['FULLTEXT_POSTGRES_TS_NOT_FOUND']; - } + return $user->lang['FULLTEXT_POSTGRES_TS_NOT_FOUND']; } return false; @@ -481,14 +463,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base $tmp_sql_match = array(); foreach (explode(',', $sql_match) as $sql_match_column) { - if ($this->tsearch_builtin) - { - $tmp_sql_match[] = "to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', " . $sql_match_column . ") @@ to_tsquery ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', '" . $db->sql_escape($this->tsearch_query) . "')"; - } - else - { - $tmp_sql_match[] = "to_tsvector (" . $sql_match_column . ") @@ to_tsquery ('" . $db->sql_escape($this->tsearch_query) . "')"; - } + $tmp_sql_match[] = "to_tsvector ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', " . $sql_match_column . ") @@ to_tsquery ('" . $db->sql_escape($config['fulltext_postgres_ts_name']) . "', '" . $db->sql_escape($this->tsearch_query) . "')"; } $sql = "SELECT $sql_select @@ -889,19 +864,10 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base

' . $user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '