Added MSQL test cases for Cast and Language.
parent
bc91a7c7b2
commit
662266a367
|
@ -0,0 +1,2 @@
|
|||
COMMENT ON CAST (money AS bigint)
|
||||
IS 'Cast from money to bigint';
|
|
@ -0,0 +1,2 @@
|
|||
COMMENT ON CAST (money AS bigint)
|
||||
IS 'Cast from money to bigint';
|
|
@ -0,0 +1,2 @@
|
|||
CREATE CAST (money AS bigint)
|
||||
WITHOUT FUNCTION;
|
|
@ -0,0 +1,3 @@
|
|||
CREATE CAST (money AS bigint)
|
||||
WITHOUT FUNCTION
|
||||
AS IMPLICIT;
|
|
@ -5,6 +5,7 @@
|
|||
"name": "Create IMPLICIT Cast",
|
||||
"endpoint": "NODE-cast.obj",
|
||||
"sql_endpoint": "NODE-cast.sql_id",
|
||||
"msql_endpoint": "NODE-cast.msql",
|
||||
"data": {
|
||||
"castcontext": "IMPLICIT",
|
||||
"encoding": "UTF8",
|
||||
|
@ -12,17 +13,20 @@
|
|||
"srctyp": "money",
|
||||
"trgtyp": "bigint"
|
||||
},
|
||||
"expected_sql_file": "create_implicit_cast.sql"
|
||||
"expected_sql_file": "create_implicit_cast.sql",
|
||||
"expected_msql_file": "create_implicit_cast_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter IMPLICIT Cast",
|
||||
"endpoint": "NODE-cast.obj_id",
|
||||
"sql_endpoint": "NODE-cast.sql_id",
|
||||
"msql_endpoint": "NODE-cast.msql_id",
|
||||
"data": {
|
||||
"description": "Cast from money to bigint"
|
||||
},
|
||||
"expected_sql_file": "alter_implicit_cast.sql"
|
||||
"expected_sql_file": "alter_implicit_cast.sql",
|
||||
"expected_msql_file": "alter_implicit_cast_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -37,6 +41,7 @@
|
|||
"name":"Create EXPLICIT Cast",
|
||||
"endpoint": "NODE-cast.obj",
|
||||
"sql_endpoint": "NODE-cast.sql_id",
|
||||
"msql_endpoint": "NODE-cast.msql",
|
||||
"data": {
|
||||
"castcontext": "EXPLICIT",
|
||||
"encoding": "UTF8",
|
||||
|
@ -44,17 +49,20 @@
|
|||
"srctyp": "money",
|
||||
"trgtyp": "bigint"
|
||||
},
|
||||
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;"
|
||||
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;",
|
||||
"expected_msql_file": "create_explicit_cast_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter EXPLICIT Cast",
|
||||
"endpoint": "NODE-cast.obj_id",
|
||||
"sql_endpoint": "NODE-cast.sql_id",
|
||||
"msql_endpoint": "NODE-cast.msql_id",
|
||||
"data": {
|
||||
"description": "Cast from money to bigint"
|
||||
},
|
||||
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;\n\nCOMMENT ON CAST (money AS bigint) IS 'Cast from money to bigint';"
|
||||
"expected_sql": "-- Cast: money -> bigint\n\n-- DROP CAST (money AS bigint);\n\nCREATE CAST (money AS bigint)\n\tWITHOUT FUNCTION;\n\nCOMMENT ON CAST (money AS bigint) IS 'Cast from money to bigint';",
|
||||
"expected_msql_file": "alter_explicit_cast_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'This is comment on custom trusted language';
|
||||
|
||||
GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
|
||||
GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO postgres WITH GRANT OPTION;
|
|
@ -0,0 +1,14 @@
|
|||
-- Language: Lan2_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
||||
COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'This is comment on custom trusted language';
|
|
@ -0,0 +1,2 @@
|
|||
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
|
||||
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM postgres;
|
|
@ -0,0 +1,2 @@
|
|||
ALTER LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME TO "Lan2_$%{}[]()&*^!@""'`\/#";
|
|
@ -0,0 +1,5 @@
|
|||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator
|
||||
;
|
|
@ -0,0 +1,5 @@
|
|||
CREATE PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator
|
||||
;
|
|
@ -5,6 +5,7 @@
|
|||
"name": "Create trusted language",
|
||||
"endpoint": "NODE-language.obj",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql",
|
||||
"data": {
|
||||
"name": "Lan1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"trusted": true,
|
||||
|
@ -13,23 +14,27 @@
|
|||
"lanval": "plpgsql_validator",
|
||||
"is_template": false
|
||||
},
|
||||
"expected_sql_file": "create_trusted_language.sql"
|
||||
"expected_sql_file": "create_trusted_language.sql",
|
||||
"expected_msql_file": "create_trusted_language_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter trusted language name",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"name": "Lan2_$%{}[]()&*^!@\"'`\\/#"
|
||||
},
|
||||
"expected_sql_file": "alter_trusted_lan_name.sql"
|
||||
"expected_sql_file": "alter_trusted_lan_name.sql",
|
||||
"expected_msql_file": "alter_trusted_lan_name_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter comment and privileges",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"description": "This is comment on custom trusted language",
|
||||
"lanacl": {
|
||||
|
@ -53,7 +58,38 @@
|
|||
}]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_comment_privileges.sql"
|
||||
"expected_sql_file": "alter_comment_privileges.sql",
|
||||
"expected_msql_file": "alter_comment_privileges_msql.sql"
|
||||
},{
|
||||
"type": "alter",
|
||||
"name": "Alter revoke privileges",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"lanacl": {
|
||||
"deleted":[{
|
||||
"grantee": "PUBLIC",
|
||||
"grantor": "postgres",
|
||||
"privileges":[
|
||||
{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}]
|
||||
},{
|
||||
"grantee": "postgres",
|
||||
"grantor": "postgres",
|
||||
"privileges":[{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": true
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_revoke_privileges.sql",
|
||||
"expected_msql_file": "alter_revoke_privileges_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -66,6 +102,7 @@
|
|||
"name": "Create untrusted language",
|
||||
"endpoint": "NODE-language.obj",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql",
|
||||
"data": {
|
||||
"name": "Lan1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"trusted": false,
|
||||
|
@ -74,7 +111,8 @@
|
|||
"lanval": "plpgsql_validator",
|
||||
"is_template": false
|
||||
},
|
||||
"expected_sql_file": "create_untrusted_language.sql"
|
||||
"expected_sql_file": "create_untrusted_language.sql",
|
||||
"expected_msql_file": "create_untrusted_language_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
-- DROP LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER spl_call_handler
|
||||
INLINE spl_inline_handler
|
||||
VALIDATOR spl_validator;
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'This is comment on custom trusted language';
|
||||
|
||||
GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
|
||||
GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO enterprisedb WITH GRANT OPTION;
|
|
@ -0,0 +1,14 @@
|
|||
-- Language: Lan2_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
||||
COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'This is comment on custom trusted language';
|
|
@ -0,0 +1,2 @@
|
|||
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
|
||||
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM enterprisedb;
|
|
@ -3,9 +3,9 @@
|
|||
-- DROP LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER spl_call_handler
|
||||
INLINE spl_inline_handler
|
||||
VALIDATOR spl_validator;
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
ALTER LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME TO "Lan2_$%{}[]()&*^!@""'`\/#";
|
|
@ -3,9 +3,9 @@
|
|||
-- DROP LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER spl_call_handler
|
||||
INLINE spl_inline_handler
|
||||
VALIDATOR spl_validator;
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
CREATE TRUSTED PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator
|
||||
;
|
|
@ -3,9 +3,9 @@
|
|||
-- DROP LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER spl_call_handler
|
||||
INLINE spl_inline_handler
|
||||
VALIDATOR spl_validator;
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator;
|
||||
|
||||
ALTER LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO <OWNER>;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
CREATE PROCEDURAL LANGUAGE "Lan1_$%{}[]()&*^!@""'`\/#"
|
||||
HANDLER plpgsql_call_handler
|
||||
INLINE plpgsql_inline_handler
|
||||
VALIDATOR plpgsql_validator
|
||||
;
|
|
@ -5,42 +5,48 @@
|
|||
"name": "Create trusted language",
|
||||
"endpoint": "NODE-language.obj",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql",
|
||||
"data": {
|
||||
"name": "Lan1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"trusted": true,
|
||||
"lanproc": "spl_call_handler",
|
||||
"laninl": "spl_inline_handler",
|
||||
"lanval": "spl_validator",
|
||||
"lanproc": "plpgsql_call_handler",
|
||||
"laninl": "plpgsql_inline_handler",
|
||||
"lanval": "plpgsql_validator",
|
||||
"is_template": false
|
||||
},
|
||||
"expected_sql_file": "create_trusted_language.sql"
|
||||
"expected_sql_file": "create_trusted_language.sql",
|
||||
"expected_msql_file": "create_trusted_language_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter trusted language name",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"name": "Lan2_$%{}[]()&*^!@\"'`\\/#"
|
||||
},
|
||||
"expected_sql_file": "alter_trusted_lan_name.sql"
|
||||
"expected_sql_file": "alter_trusted_lan_name.sql",
|
||||
"expected_msql_file": "alter_trusted_lan_name_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter comment and privileges",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"description": "This is comment on custom trusted language",
|
||||
"lanacl": {
|
||||
"added":[{
|
||||
"grantee": "PUBLIC",
|
||||
"grantor": "enterprisedb",
|
||||
"privileges":[{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}]
|
||||
"privileges":[
|
||||
{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}]
|
||||
},{
|
||||
"grantee": "enterprisedb",
|
||||
"grantor": "enterprisedb",
|
||||
|
@ -52,7 +58,38 @@
|
|||
}]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_comment_privileges.sql"
|
||||
"expected_sql_file": "alter_comment_privileges.sql",
|
||||
"expected_msql_file": "alter_comment_privileges_msql.sql"
|
||||
},{
|
||||
"type": "alter",
|
||||
"name": "Alter revoke privileges",
|
||||
"endpoint": "NODE-language.obj_id",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql_id",
|
||||
"data": {
|
||||
"lanacl": {
|
||||
"deleted":[{
|
||||
"grantee": "PUBLIC",
|
||||
"grantor": "enterprisedb",
|
||||
"privileges":[
|
||||
{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}]
|
||||
},{
|
||||
"grantee": "enterprisedb",
|
||||
"grantor": "enterprisedb",
|
||||
"privileges":[{
|
||||
"privilege_type": "U",
|
||||
"privilege": true,
|
||||
"with_grant": true
|
||||
}]
|
||||
}]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_revoke_privileges.sql",
|
||||
"expected_msql_file": "alter_revoke_privileges_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -65,15 +102,17 @@
|
|||
"name": "Create untrusted language",
|
||||
"endpoint": "NODE-language.obj",
|
||||
"sql_endpoint": "NODE-language.sql_id",
|
||||
"msql_endpoint": "NODE-language.msql",
|
||||
"data": {
|
||||
"name": "Lan1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"trusted": false,
|
||||
"lanproc": "spl_call_handler",
|
||||
"laninl": "spl_inline_handler",
|
||||
"lanval": "spl_validator",
|
||||
"lanproc": "plpgsql_call_handler",
|
||||
"laninl": "plpgsql_inline_handler",
|
||||
"lanval": "plpgsql_validator",
|
||||
"is_template": false
|
||||
},
|
||||
"expected_sql_file": "create_untrusted_language.sql"
|
||||
"expected_sql_file": "create_untrusted_language.sql",
|
||||
"expected_msql_file": "create_untrusted_language_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
|
Loading…
Reference in New Issue