From ca108000a35e70335b4939eb0298a1f166b5c5f6 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Sun, 22 Dec 2024 01:50:08 +0900 Subject: [PATCH] Reflects some of the code review content. --- src/executables/unload_schema.c | 11 ++--------- src/object/schema_system_catalog_install.cpp | 2 +- .../schema_system_catalog_install_query_spec.cpp | 2 +- src/parser/xasl_generation.c | 6 ++++-- src/sp/jsp_cl.cpp | 6 ++++-- src/sp/pl_signature.hpp | 5 ++++- src/sp/sp_catalog.hpp | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/executables/unload_schema.c b/src/executables/unload_schema.c index 22209b315a..83e197c835 100644 --- a/src/executables/unload_schema.c +++ b/src/executables/unload_schema.c @@ -4532,16 +4532,9 @@ emit_stored_procedure_pre (extract_context & ctxt, print_output & output_ctx) } // dtrm_type - if (sp_type == SP_TYPE_FUNCTION) + if (directive & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_DETERMINISTIC) { - if (directive & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_RIGHTS_DETERMINISTIC) - { - output_ctx ("DETERMINISTIC "); - } - else - { - output_ctx ("NOT DETERMINISTIC "); - } + output_ctx ("DETERMINISTIC "); } int sp_lang = db_get_int (&lang_val); diff --git a/src/object/schema_system_catalog_install.cpp b/src/object/schema_system_catalog_install.cpp index c0aa1fa2a6..35da10640e 100644 --- a/src/object/schema_system_catalog_install.cpp +++ b/src/object/schema_system_catalog_install.cpp @@ -1815,7 +1815,7 @@ namespace cubschema {"arg_count", "integer"}, {"lang", "varchar(16)"}, {"authid", "varchar(16)"}, - {"dtrm_type", "varchar(20)"}, + {"is_deterministic", "varchar(3)"}, {"target", "varchar(4096)"}, {"owner", "varchar(256)"}, {"code", format_varchar (1073741823)}, diff --git a/src/object/schema_system_catalog_install_query_spec.cpp b/src/object/schema_system_catalog_install_query_spec.cpp index 1262bf20a2..4ca678c57f 100644 --- a/src/object/schema_system_catalog_install_query_spec.cpp +++ b/src/object/schema_system_catalog_install_query_spec.cpp @@ -1238,7 +1238,7 @@ sm_define_view_stored_procedure_spec (void) "[sp].[arg_count] AS [arg_count], " "CASE [sp].[lang] WHEN 0 THEN 'PLCSQL' WHEN 1 THEN 'JAVA' ELSE 'UNKNOWN' END AS [lang], " "CASE [sp].[directive] & 1 WHEN 0 THEN 'DEFINER' ELSE 'CURRENT_USER' END AS [authid], " - "CASE [sp].[directive] & 2 WHEN 0 THEN 'NOT DETERMINISTIC' ELSE 'DETERMINISTIC' END AS [dtrm_type], " + "CASE [sp].[directive] & 2 WHEN 0 THEN 'NO' ELSE 'YES' END AS [deterministic], " "CONCAT ([sp].[target_class], '.', [sp].[target_method]) AS [target], " "CAST ([sp].[owner].[name] AS VARCHAR(255)) AS [owner], " /* string -> varchar(255) */ "[sp_code].[scode] AS [code], " diff --git a/src/parser/xasl_generation.c b/src/parser/xasl_generation.c index ff878fd0e1..f96d9d6222 100644 --- a/src/parser/xasl_generation.c +++ b/src/parser/xasl_generation.c @@ -27624,18 +27624,20 @@ pt_make_sq_cache_key_struct (QPROC_DB_VALUE_LIST key_struct, void *p, int type) } break; case TYPE_SP: - regu_var_list_p = regu_src->value.sp_ptr->args; - /* The value of regu_src->value.sp_ptr->sig->is_deterministic is interpreted as follows * 0: PT_AUTHID_OWNER + PT_NOT_DETERMINISTIC * 1: PT_AUTHID_CALLER + PT_NOT_DETERMINISTIC * 2: PT_AUTHID_OWNER + PT_DETERMINISTIC * 3: PT_AUTHID_CALLER + PT_DETERMINISTIC */ +#if defined (CS_MODE) if (regu_src->value.sp_ptr->sig->is_deterministic == false) { return ER_FAILED; } +#endif + + regu_var_list_p = regu_src->value.sp_ptr->args; while (regu_var_list_p) { diff --git a/src/sp/jsp_cl.cpp b/src/sp/jsp_cl.cpp index fa52a010e5..fe9e4d401b 100644 --- a/src/sp/jsp_cl.cpp +++ b/src/sp/jsp_cl.cpp @@ -1491,7 +1491,7 @@ jsp_map_pt_to_sp_dtrm_type (PT_MISC_TYPE pt_dtrm_type, SP_DIRECTIVE_ENUM directi if (pt_dtrm_type == PT_DETERMINISTIC) { directive = static_cast (static_cast (directive) | static_cast - (SP_DIRECTIVE_ENUM::SP_DIRECTIVE_RIGHTS_DETERMINISTIC)); + (SP_DIRECTIVE_ENUM::SP_DIRECTIVE_DETERMINISTIC)); } return directive; @@ -2113,8 +2113,9 @@ jsp_make_pl_signature (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *subquery_ goto exit; } +#if defined (CS_MODE) sig.auth = db_private_strdup (NULL, auth_name); - if ((directive & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_RIGHTS_DETERMINISTIC)) + if (directive & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_DETERMINISTIC) { sig.is_deterministic = true; } @@ -2122,6 +2123,7 @@ jsp_make_pl_signature (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *subquery_ { sig.is_deterministic = false; } +#endif sig.result_type = result_type; if (! (directive & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_RIGHTS_CALLER)) diff --git a/src/sp/pl_signature.hpp b/src/sp/pl_signature.hpp index a63e029206..947a4c900a 100644 --- a/src/sp/pl_signature.hpp +++ b/src/sp/pl_signature.hpp @@ -92,9 +92,12 @@ namespace cubpl int type; // PL_TYPE char *name; char *auth; - bool is_deterministic; // DETERMINISTIC int result_type; // DB_TYPE +#if defined (CS_MODE) + bool is_deterministic; // DETERMINISTIC +#endif + pl_arg arg; pl_ext ext; diff --git a/src/sp/sp_catalog.hpp b/src/sp/sp_catalog.hpp index 2fb470269c..17623a7a00 100644 --- a/src/sp/sp_catalog.hpp +++ b/src/sp/sp_catalog.hpp @@ -130,7 +130,7 @@ enum sp_directive : int { SP_DIRECTIVE_RIGHTS_OWNER = 0x00, SP_DIRECTIVE_RIGHTS_CALLER = (0x01 << 0), - SP_DIRECTIVE_RIGHTS_DETERMINISTIC = (0x01 << 1), + SP_DIRECTIVE_DETERMINISTIC = (0x01 << 1), }; typedef sp_directive SP_DIRECTIVE_ENUM;