Skip to content

Commit

Permalink
disable the custom fts parser guc by default, (#2074) (#2076)
Browse files Browse the repository at this point in the history
Need this for disabling the custom fts parser guc so that feature is enabled.

Task: BABEL-4379
Signed-off-by: Roshan Kanwar [email protected]
  • Loading branch information
roshan0708 authored Nov 28, 2023
1 parent f56d9a4 commit aba0451
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 157 deletions.
2 changes: 1 addition & 1 deletion contrib/babelfishpg_tsql/src/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ define_custom_variables(void)
gettext_noop("GUC for enabling or disabling full text search features"),
NULL,
&pltsql_allow_fulltext_parser,
false,
true,
PGC_SUSET,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_SUPERUSER_ONLY,
NULL, NULL, NULL);
Expand Down
21 changes: 0 additions & 21 deletions test/JDBC/expected/FULLTEXT_INDEX-vu-cleanup.out
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
-- psql
-- enable CONTAINS
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~


-- tsql user=testLogin password=abc
USE master;
GO
Expand Down Expand Up @@ -160,13 +149,3 @@ text
strict
~~END~~


-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~

22 changes: 1 addition & 21 deletions test/JDBC/expected/FULLTEXT_INDEX-vu-prepare.out
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
-- psql
-- enable CONTAINS
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~


-- tsql user=jdbc_user password=12345678
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
~~START~~
Expand Down Expand Up @@ -203,13 +193,3 @@ text
strict
~~END~~


-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~

21 changes: 0 additions & 21 deletions test/JDBC/expected/FULLTEXT_INDEX-vu-verify.out
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
-- psql
-- enable CONTAINS
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~


-- tsql user=jdbc_user password=12345678
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
Expand Down Expand Up @@ -180,13 +169,3 @@ text
strict
~~END~~


-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~

14 changes: 2 additions & 12 deletions test/JDBC/expected/fts-contains-vu-cleanup.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- tsql user=jdbc_user password=12345678
-- enable CONTAINS
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
~~START~~
Expand All @@ -20,21 +20,11 @@ GO
DROP VIEW fts_contains_pgconfig_v1
GO

-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO
~~START~~
text
strict
~~END~~


-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~

14 changes: 2 additions & 12 deletions test/JDBC/expected/fts-contains-vu-prepare.out
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
-- psql
-- enable CONTAINS
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~


-- tsql user=jdbc_user password=12345678
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
~~START~~
Expand Down Expand Up @@ -5061,7 +5051,7 @@ GO
~~ROW COUNT: 1~~


-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO
~~START~~
Expand Down
15 changes: 2 additions & 13 deletions test/JDBC/expected/fts-contains-vu-verify.out
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
-- psql
-- enable CONTAINS
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO
~~START~~
bool
t
~~END~~


-- tsql user=jdbc_user password=12345678
-- enable CONTAINS
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
~~START~~
Expand Down Expand Up @@ -405,7 +394,7 @@ GO
~~ERROR (Message: Generation term is not currently supported in Babelfish)~~


-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO
~~START~~
Expand Down
11 changes: 0 additions & 11 deletions test/JDBC/input/full_text_search/FULLTEXT_INDEX-vu-cleanup.mix
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
-- enable CONTAINS
-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO

-- tsql user=testLogin password=abc
USE master;
GO
Expand Down Expand Up @@ -121,9 +115,4 @@ GO

-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO

-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
12 changes: 1 addition & 11 deletions test/JDBC/input/full_text_search/FULLTEXT_INDEX-vu-prepare.mix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
-- enable CONTAINS
-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO

-- enable FULLTEXT
-- tsql user=jdbc_user password=12345678
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
Expand Down Expand Up @@ -165,9 +160,4 @@ GO

-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO

-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
11 changes: 0 additions & 11 deletions test/JDBC/input/full_text_search/FULLTEXT_INDEX-vu-verify.mix
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
-- enable CONTAINS
-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO

-- enable FULLTEXT
-- tsql user=jdbc_user password=12345678
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
Expand Down Expand Up @@ -83,9 +77,4 @@ GO

-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO

-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
11 changes: 3 additions & 8 deletions test/JDBC/input/full_text_search/fts-contains-vu-cleanup.mix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- tsql user=jdbc_user password=12345678
-- enable CONTAINS
-- enable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO

Expand All @@ -15,11 +15,6 @@ GO
DROP VIEW fts_contains_pgconfig_v1
GO

-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO

-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = off;
SELECT pg_reload_conf();
GO
GO
9 changes: 2 additions & 7 deletions test/JDBC/input/full_text_search/fts-contains-vu-prepare.mix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
-- enable CONTAINS
-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO

-- enable FULLTEXT
-- tsql user=jdbc_user password=12345678
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO
Expand Down Expand Up @@ -3047,6 +3042,6 @@ GO
INSERT INTO fts_contains_vu_t VALUES (1000, 'Last month , scientists from the Hebrew University of Jerusalem reported that washing down red meat with a glass of red can actually prevent the build-up of cholesterol in the body ')
GO

-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO
10 changes: 2 additions & 8 deletions test/JDBC/input/full_text_search/fts-contains-vu-verify.mix
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
-- enable CONTAINS
-- psql
ALTER SYSTEM SET babelfishpg_tsql.allow_fulltext_parser = on;
SELECT pg_reload_conf();
GO

-- enable FULLTEXT
-- tsql user=jdbc_user password=12345678
-- enable CONTAINS
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'ignore', 'false')
GO

Expand Down Expand Up @@ -125,6 +119,6 @@ GO
EXEC fts_contains_vu_prepare_p1 'FORMSOF(THESAURUS, love)'
GO

-- disable CONTAINS
-- disable FULLTEXT
SELECT set_config('babelfishpg_tsql.escape_hatch_fulltext', 'strict', 'false')
GO

0 comments on commit aba0451

Please sign in to comment.