Added Modified SQL test cases for FTS Configurations.

This commit is contained in:
Ganesh Jaybhay 2019-09-03 17:42:44 +05:30 committed by Akshay Joshi
parent 4690700a24
commit 85baa22ca1
8 changed files with 39 additions and 7 deletions

View File

@ -0,0 +1,2 @@
COMMENT ON TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1
IS 'test comment';

View File

@ -0,0 +1,3 @@
ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1
ADD MAPPING FOR file
WITH english_stem;

View File

@ -0,0 +1,2 @@
ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def2
DROP MAPPING FOR word;

View File

@ -0,0 +1,2 @@
ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1
RENAME TO test_fts_configuration;

View File

@ -0,0 +1,3 @@
CREATE TEXT SEARCH CONFIGURATION test."test_fts_conf_$%{}[]()&*^!@""'`\/#" (
PARSER = default
);

View File

@ -0,0 +1,3 @@
CREATE TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1 (
PARSER = default
);

View File

@ -0,0 +1,3 @@
CREATE TEXT SEARCH CONFIGURATION test.test_fts_configuration_def2 (
COPY=english
);

View File

@ -4,6 +4,7 @@
"name": "Create FTS Configuration", "name": "Create FTS Configuration",
"endpoint": "NODE-fts_configuration.obj", "endpoint": "NODE-fts_configuration.obj",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql",
"data": { "data": {
"name": "test_fts_conf_$%{}[]()&*^!@\"'`\\/#", "name": "test_fts_conf_$%{}[]()&*^!@\"'`\\/#",
"schema": "test", "schema": "test",
@ -11,7 +12,8 @@
"prsname": "default", "prsname": "default",
"tokens": [] "tokens": []
}, },
"expected_sql_file": "create_fts_conf.sql" "expected_sql_file": "create_fts_conf.sql",
"expected_msql_file": "msql_create_fts_conf.sql"
}, { }, {
"type": "delete", "type": "delete",
"name": "Drop FTS Configuration", "name": "Drop FTS Configuration",
@ -24,6 +26,7 @@
"name": "Create FTS Configuration with Parser", "name": "Create FTS Configuration with Parser",
"endpoint": "NODE-fts_configuration.obj", "endpoint": "NODE-fts_configuration.obj",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql",
"data": { "data": {
"name": "test_fts_configuration_def1", "name": "test_fts_configuration_def1",
"schema": "test", "schema": "test",
@ -31,34 +34,41 @@
"prsname": "default", "prsname": "default",
"tokens": [] "tokens": []
}, },
"expected_sql_file": "create_fts_conf_def1.sql" "expected_sql_file": "create_fts_conf_def1.sql",
"expected_msql_file": "msql_create_fts_conf_def1.sql"
}, { }, {
"type": "alter", "type": "alter",
"name": "Alter FTS Configuration add comment", "name": "Alter FTS Configuration add comment",
"endpoint": "NODE-fts_configuration.obj_id", "endpoint": "NODE-fts_configuration.obj_id",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql_id",
"data": { "data": {
"description": "test comment" "description": "test comment"
}, },
"expected_sql_file": "alter_fts_conf_add_comment.sql" "expected_sql_file": "alter_fts_conf_add_comment.sql",
"expected_msql_file": "msql_alter_fts_conf_add_comment.sql"
}, { }, {
"type": "alter", "type": "alter",
"name": "Alter FTS Configuration add token file", "name": "Alter FTS Configuration add token file",
"endpoint": "NODE-fts_configuration.obj_id", "endpoint": "NODE-fts_configuration.obj_id",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql_id",
"data": { "data": {
"tokens": {"added": [{"token": "file", "dictname": ["english_stem"]}]} "tokens": {"added": [{"token": "file", "dictname": ["english_stem"]}]}
}, },
"expected_sql_file": "alter_fts_conf_add_token.sql" "expected_sql_file": "alter_fts_conf_add_token.sql",
"expected_msql_file": "msql_alter_fts_conf_add_token.sql"
}, { }, {
"type": "alter", "type": "alter",
"name": "Alter FTS Configuration Rename", "name": "Alter FTS Configuration Rename",
"endpoint": "NODE-fts_configuration.obj_id", "endpoint": "NODE-fts_configuration.obj_id",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql_id",
"data": { "data": {
"name": "test_fts_configuration" "name": "test_fts_configuration"
}, },
"expected_sql_file": "alter_fts_conf_rename.sql" "expected_sql_file": "alter_fts_conf_rename.sql",
"expected_msql_file": "msql_alter_fts_conf_rename.sql"
}, { }, {
"type": "delete", "type": "delete",
"name": "Drop FTS Configuration with parser", "name": "Drop FTS Configuration with parser",
@ -71,22 +81,26 @@
"name": "Create FTS Configuration with copy config", "name": "Create FTS Configuration with copy config",
"endpoint": "NODE-fts_configuration.obj", "endpoint": "NODE-fts_configuration.obj",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql",
"data": { "data": {
"name": "test_fts_configuration_def2", "name": "test_fts_configuration_def2",
"schema": "test", "schema": "test",
"schema_id": "<SCHEMA_ID>", "schema_id": "<SCHEMA_ID>",
"copy_config": "english" "copy_config": "english"
}, },
"expected_sql_file": "create_fts_conf_def2.sql" "expected_sql_file": "create_fts_conf_def2.sql",
"expected_msql_file": "msql_create_fts_conf_def2.sql"
}, { }, {
"type": "alter", "type": "alter",
"name": "Alter FTS Configuration remove token file", "name": "Alter FTS Configuration remove token file",
"endpoint": "NODE-fts_configuration.obj_id", "endpoint": "NODE-fts_configuration.obj_id",
"sql_endpoint": "NODE-fts_configuration.sql_id", "sql_endpoint": "NODE-fts_configuration.sql_id",
"msql_endpoint": "NODE-fts_configuration.msql_id",
"data": { "data": {
"tokens": {"deleted": [{"token": "word", "dictname": ["english_stem"]}]} "tokens": {"deleted": [{"token": "word", "dictname": ["english_stem"]}]}
}, },
"expected_sql_file": "alter_fts_conf_remove_token.sql" "expected_sql_file": "alter_fts_conf_remove_token.sql",
"expected_msql_file": "msql_alter_fts_conf_remove_token.sql"
}, { }, {
"type": "delete", "type": "delete",
"name": "Drop FTS Configuration with copy config", "name": "Drop FTS Configuration with copy config",