diff --git a/docs/en_US/release_notes_4_13.rst b/docs/en_US/release_notes_4_13.rst index e748cd060..6a22e3cc1 100644 --- a/docs/en_US/release_notes_4_13.rst +++ b/docs/en_US/release_notes_4_13.rst @@ -19,6 +19,7 @@ Housekeeping | `Issue #4575 `_ - Add Reverse Engineered SQL tests for Schemas. | `Issue #4576 `_ - Add Reverse Engineered SQL tests for Views. | `Issue #4600 `_ - Add Reverse Engineered SQL tests for Rules. +| `Issue #4619 `_ - Add Reverse Engineered and Modified SQL tests for FTS Templates. Bug fixes ********* diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/tests/default/test.json index 4cce68467..d4de910de 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/tests/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/tests/default/test.json @@ -33,7 +33,7 @@ "name": "Drop FTS Parser", "endpoint": "NODE-fts_parser.delete_id", "data": { - "name": "test_fts_configuration_def2" + "name": "test_fts_parser_updated_$%{}[]()&*^!@\"'`\\/#" } } ] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment.sql new file mode 100644 index 000000000..d1c3a51a6 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment.sql @@ -0,0 +1,10 @@ +-- Text Search Template: test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + +-- DROP TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + +CREATE TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" ( + INIT = dsimple_init, + LEXIZE = dsimple_lexize +); + +COMMENT ON TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" IS 'Comment on FTS Template'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment_msql.sql new file mode 100644 index 000000000..ee408d092 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_comment_msql.sql @@ -0,0 +1,2 @@ +COMMENT ON TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + IS 'Comment on FTS Template'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename.sql new file mode 100644 index 000000000..c56ddf7a6 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename.sql @@ -0,0 +1,8 @@ +-- Text Search Template: test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + +-- DROP TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + +CREATE TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" ( + INIT = dsimple_init, + LEXIZE = dsimple_lexize +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename_msql.sql new file mode 100644 index 000000000..e432e9558 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_rename_msql.sql @@ -0,0 +1,2 @@ +ALTER TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" + RENAME TO "FTSTemp1_$%{}[]()&*^!@""'`\/#"; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_schema_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_schema_msql.sql new file mode 100644 index 000000000..5ed9ea6f1 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/alter_schema_msql.sql @@ -0,0 +1,2 @@ +ALTER TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#" + SET SCHEMA public; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create.sql new file mode 100644 index 000000000..4515c8d23 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create.sql @@ -0,0 +1,8 @@ +-- Text Search Template: test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" + +-- DROP TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" + +CREATE TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" ( + INIT = dsimple_init, + LEXIZE = dsimple_lexize +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create_msql.sql new file mode 100644 index 000000000..c89ca6ce1 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/create_msql.sql @@ -0,0 +1,3 @@ +CREATE TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" ( + INIT = dsimple_init, LEXIZE = dsimple_lexize +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/test.json new file mode 100644 index 000000000..c48120bc4 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/tests/default/test.json @@ -0,0 +1,63 @@ +{ + "scenarios": [ + { + "type": "create", + "name": "Create FTS Template", + "endpoint": "NODE-fts_template.obj", + "sql_endpoint": "NODE-fts_template.sql_id", + "msql_endpoint": "NODE-fts_template.msql", + "data": { + "name": "FTSTemp_$%{}[]()&*^!@\"'`\\/#", + "schema": "test_fts_template", + "schema_id": "", + "tmplinit": "dsimple_init", + "tmpllexize": "dsimple_lexize" + }, + "expected_sql_file": "create.sql", + "expected_msql_file": "create_msql.sql" + }, + { + "type": "alter", + "name": "Alter Rename FTS Template", + "endpoint": "NODE-fts_template.obj_id", + "sql_endpoint": "NODE-fts_template.sql_id", + "msql_endpoint": "NODE-fts_template.msql_id", + "data": { + "name": "FTSTemp1_$%{}[]()&*^!@\"'`\\/#" + }, + "expected_sql_file": "alter_rename.sql", + "expected_msql_file": "alter_rename_msql.sql" + }, + { + "type": "alter", + "name": "Alter comment of FTS Template", + "endpoint": "NODE-fts_template.obj_id", + "sql_endpoint": "NODE-fts_template.sql_id", + "msql_endpoint": "NODE-fts_template.msql_id", + "data": { + "description": "Comment on FTS Template" + }, + "expected_sql_file": "alter_comment.sql", + "expected_msql_file": "alter_comment_msql.sql" + }, + { + "type": "alter", + "name": "Alter schema of FTS Template", + "endpoint": "NODE-fts_template.obj_id", + "sql_endpoint": "NODE-fts_template.sql_id", + "msql_endpoint": "NODE-fts_template.msql_id", + "data": { + "schema": "2200" + }, + "expected_msql_file": "alter_schema_msql.sql" + }, + { + "type": "delete", + "name": "Drop FTS template", + "endpoint": "NODE-fts_template.delete_id", + "data": { + "name": "FTSTemp_$%{}[]()&*^!@\"'`\\/#" + } + } + ] +}