Add Reverse Engineered SQL tests for Sequences. Fixes #4469

This commit is contained in:
Aditya Toshniwal 2019-07-15 14:56:22 +01:00 committed by Dave Page
parent 0b82a4ad92
commit d3ef1137d9
9 changed files with 191 additions and 1 deletions

View File

@ -27,7 +27,7 @@ Housekeeping
| `Issue #4464 <https://redmine.postgresql.org/issues/4464>`_ - Add Reverse Engineered SQL tests for Collations.
| `Issue #4468 <https://redmine.postgresql.org/issues/4468>`_ - Add Reverse Engineered SQL tests for Types.
| `Issue #4471 <https://redmine.postgresql.org/issues/4471>`_ - Add Reverse Engineered SQL tests for FTS Parsers.
| `Issue #4469 <https://redmine.postgresql.org/issues/4469>`_ - Add Reverse Engineered SQL tests for Sequences.
Bug fixes
*********

View File

@ -0,0 +1,16 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
INCREMENT 5
START 5
MINVALUE 5
MAXVALUE 999
CACHE 1;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';

View File

@ -0,0 +1,17 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
CYCLE
INCREMENT 12
START 7
MINVALUE 2
MAXVALUE 9992
CACHE 2;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';

View File

@ -0,0 +1,13 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
INCREMENT 5
START 5
MINVALUE 5
MAXVALUE 999
CACHE 1;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;

View File

@ -0,0 +1,49 @@
{
"scenarios": [
{
"type": "create",
"name": "Create Sequence",
"endpoint": "NODE-sequence.obj",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"name": "Seq1_$%{}[]()&*^!@\"'`\\/#",
"seqowner": "postgres",
"schema": "public",
"increment": "5",
"start": "5",
"maximum": "999",
"minimum": "5",
"cache": "1",
"cycled": false,
"relacl": [],
"securities": []
},
"expected_sql_file": "create_sequence.sql"
},{
"type": "alter",
"name": "Alter Sequence comment",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"comment": "Some comment"
},
"expected_sql_file": "alter_seq_comment.sql"
},{
"type": "alter",
"name": "Alter Sequence properties",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"current_value": "7", "increment": "12", "minimum": "2", "maximum": "9992", "cache": "2", "cycled": true
},
"expected_sql_file": "alter_seq_props.sql"
},{
"type": "delete",
"name": "Drop sequence",
"endpoint": "NODE-sequence.delete_id",
"data": {
"name": "Seq1_$%{}[]()&*^!@\"'`\\/#"
}
}
]
}

View File

@ -0,0 +1,16 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
INCREMENT 5
START 5
MINVALUE 5
MAXVALUE 999
CACHE 1;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';

View File

@ -0,0 +1,17 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
CYCLE
INCREMENT 12
START 7
MINVALUE 2
MAXVALUE 9992
CACHE 2;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
IS 'Some comment';

View File

@ -0,0 +1,13 @@
-- SEQUENCE: public."Seq1_$%{}[]()&*^!@""'`\/#"
-- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
INCREMENT 5
START 5
MINVALUE 5
MAXVALUE 999
CACHE 1;
ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;

View File

@ -0,0 +1,49 @@
{
"scenarios": [
{
"type": "create",
"name": "Create Sequence",
"endpoint": "NODE-sequence.obj",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"name": "Seq1_$%{}[]()&*^!@\"'`\\/#",
"seqowner": "postgres",
"schema": "public",
"increment": "5",
"start": "5",
"maximum": "999",
"minimum": "5",
"cache": "1",
"cycled": false,
"relacl": [],
"securities": []
},
"expected_sql_file": "create_sequence.sql"
},{
"type": "alter",
"name": "Alter Sequence comment",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"comment": "Some comment"
},
"expected_sql_file": "alter_seq_comment.sql"
},{
"type": "alter",
"name": "Alter Sequence properties",
"endpoint": "NODE-sequence.obj_id",
"sql_endpoint": "NODE-sequence.sql_id",
"data": {
"current_value": "7", "increment": "12", "minimum": "2", "maximum": "9992", "cache": "2", "cycled": true
},
"expected_sql_file": "alter_seq_props.sql"
},{
"type": "delete",
"name": "Drop sequence",
"endpoint": "NODE-sequence.delete_id",
"data": {
"name": "Seq1_$%{}[]()&*^!@\"'`\\/#"
}
}
]
}