Add Reverse Engineered and Modified SQL tests for FTS Templates. Fixes #4619

pull/26/head
Akshay Joshi 2019-09-02 15:24:41 +05:30
parent 662266a367
commit 5ff3f40116
10 changed files with 100 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Housekeeping
| `Issue #4575 <https://redmine.postgresql.org/issues/4575>`_ - Add Reverse Engineered SQL tests for Schemas.
| `Issue #4576 <https://redmine.postgresql.org/issues/4576>`_ - Add Reverse Engineered SQL tests for Views.
| `Issue #4600 <https://redmine.postgresql.org/issues/4600>`_ - Add Reverse Engineered SQL tests for Rules.
| `Issue #4619 <https://redmine.postgresql.org/issues/4619>`_ - Add Reverse Engineered and Modified SQL tests for FTS Templates.
Bug fixes
*********

View File

@ -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_$%{}[]()&*^!@\"'`\\/#"
}
}
]

View File

@ -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';

View File

@ -0,0 +1,2 @@
COMMENT ON TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#"
IS 'Comment on FTS Template';

View File

@ -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
);

View File

@ -0,0 +1,2 @@
ALTER TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#"
RENAME TO "FTSTemp1_$%{}[]()&*^!@""'`\/#";

View File

@ -0,0 +1,2 @@
ALTER TEXT SEARCH TEMPLATE test_fts_template."FTSTemp1_$%{}[]()&*^!@""'`\/#"
SET SCHEMA public;

View File

@ -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
);

View File

@ -0,0 +1,3 @@
CREATE TEXT SEARCH TEMPLATE test_fts_template."FTSTemp_$%{}[]()&*^!@""'`\/#" (
INIT = dsimple_init, LEXIZE = dsimple_lexize
);

View File

@ -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": "<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_$%{}[]()&*^!@\"'`\\/#"
}
}
]
}