From a099d3740a2a9390b1dd9846a33383b50840107b Mon Sep 17 00:00:00 2001 From: Jongmin Won Date: Tue, 5 Mar 2024 17:18:25 +0900 Subject: [PATCH 01/21] ADD Syntax ALTER SERIAL .. OWNER TO .. --- src/parser/csql_grammar.y | 20 ++++++++++++++++++++ src/parser/parse_tree.h | 1 + src/parser/parse_tree_cl.c | 8 ++++++++ src/query/execute_statement.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+) diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index ca9cb5cb238..9157d37f9f6 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3721,6 +3721,26 @@ alter_stmt MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); } + DBG_PRINT}} + | ALTER /* 1 */ + SERIAL /* 2 */ + serial_name /* 3 */ + OWNER TO identifier /* 4, 5, 6 */ + opt_comment_spec /* 7 */ + {{ DBG_TRACE_GRAMMAR(alter_stmt, | ALTER SERIAL serial_name OWNER TO identifier opt_comment_spec); + + PT_NODE *node = parser_new_node (this_parser, PT_ALTER_SERIAL); + + if (node) + { + node->info.serial.serial_name = $3; + node->info.serial.owner_name = $6; + node->info.serial.comment = $7; + } + + $$ = node; + PARSER_SAVE_ERR_CONTEXT ($$, @$.buffer_pos) + DBG_PRINT}} | ALTER /* 1 */ { /* 2 */ diff --git a/src/parser/parse_tree.h b/src/parser/parse_tree.h index c01c24f760c..803653cb050 100644 --- a/src/parser/parse_tree.h +++ b/src/parser/parse_tree.h @@ -2174,6 +2174,7 @@ struct pt_serial_info PT_NODE *max_val; /* PT_VALUE */ PT_NODE *min_val; /* PT_VALUE */ PT_NODE *cached_num_val; /* PT_VALUE */ + PT_NODE *owner_name; /* PT_NAME */ PT_NODE *comment; /* PT_VALUE */ int cyclic; int no_max; diff --git a/src/parser/parse_tree_cl.c b/src/parser/parse_tree_cl.c index 7c3752a3e79..717e7e6ed29 100644 --- a/src/parser/parse_tree_cl.c +++ b/src/parser/parse_tree_cl.c @@ -8138,6 +8138,13 @@ pt_print_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p) q = pt_append_nulstring (parser, q, " nocache "); } + if (p->info.serial.owner_name != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.owner_name); + q = pt_append_nulstring (parser, q, " owner to "); + q = pt_append_varchar (parser, q, r1); + } + if (p->info.serial.comment != NULL) { r1 = pt_print_bytes (parser, p->info.serial.comment); @@ -8252,6 +8259,7 @@ pt_apply_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p, void *arg) PT_APPLY_WALK (parser, p->info.serial.increment_val, arg); PT_APPLY_WALK (parser, p->info.serial.min_val, arg); PT_APPLY_WALK (parser, p->info.serial.max_val, arg); + PT_APPLY_WALK (parser, p->info.serial.owner_name, arg); return p; } diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index 3414ee9a63b..e317dc82f41 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2318,6 +2318,10 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) DB_VALUE abs_inc_val, range_val; int cached_num; int ret_msg_id = 0; + + PT_NODE *serial_owner = NULL; + const char *serial_owner_name = NULL; + DB_VALUE serial_name_val, returnval, serial_owner_val; const char *comment = NULL; int new_inc_val_flag = 0, new_cyclic; @@ -2347,6 +2351,9 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) db_make_null (&class_name_val); db_make_null (&abs_inc_val); db_make_null (&range_val); + db_make_null (&serial_name_val); + db_make_null (&returnval); + db_make_null (&serial_owner_val); OID_SET_NULL (&serial_obj_id); /* @@ -2848,6 +2855,27 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) pr_clear_value (&value); } + /* owner to */ + serial_owner = statement->info.serial.owner_name; + if (serial_owner != NULL) + { + serial_owner_name = serial_owner->info.name.original; + + db_make_string (&serial_name_val, (char *) PT_NODE_SR_NAME (statement)); + db_make_string (&serial_owner_val, serial_owner_name); + + au_change_serial_owner_method (serial_class, &returnval, &serial_name_val, &serial_owner_val); + + pr_clear_value (&serial_name_val); + pr_clear_value (&serial_owner_val); + + if (DB_VALUE_TYPE (&returnval) == DB_TYPE_ERROR) + { + error = db_get_error (&returnval); + goto end; + } + } + /* comment */ if (statement->info.serial.comment != NULL) { From 92e8f4e56f64851deebc60137ed59e12f4eda360 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Sat, 9 Mar 2024 22:37:42 +0900 Subject: [PATCH 02/21] 1) style: Change au_change_serial_owner_method() to au_change_serial_owner(), 2) Fix feat: Modified to decache only when executing the opt_serial_option_list option when executing the alter serial syntax --- src/object/authenticate.c | 1 - src/object/authenticate.h | 1 + src/query/execute_statement.c | 43 +++++++++++++++++++++++------------ 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index ccbdd441584..dabbe07fd59 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -562,7 +562,6 @@ static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); -static int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); /* * DB_ EXTENSION FUNCTIONS */ diff --git a/src/object/authenticate.h b/src/object/authenticate.h index 6a2468b280d..288ac93714a 100644 --- a/src/object/authenticate.h +++ b/src/object/authenticate.h @@ -236,6 +236,7 @@ extern int au_check_user (void); extern char *au_get_user_name (MOP obj); extern bool au_is_dba_group_member (MOP user); extern bool au_is_user_group_member (MOP group_user, MOP user); +extern int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); extern void au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial_val, DB_VALUE * owner_val); /* debugging functions */ diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index e317dc82f41..dc1d9730b12 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2320,10 +2320,13 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) int ret_msg_id = 0; PT_NODE *serial_owner = NULL; - const char *serial_owner_name = NULL; - DB_VALUE serial_name_val, returnval, serial_owner_val; + const char *serial_name = NULL, *serial_owner_name = NULL; + char user_specified_serial_name[DB_MAX_SERIAL_NAME_LENGTH] = { '\0' }; + MOP serial_mop = NULL, owner_mop = NULL; const char *comment = NULL; + bool opt_serial_option_list_flag = false; + int new_inc_val_flag = 0, new_cyclic; bool cur_val_change, inc_val_change, max_val_change, min_val_change, cyclic_change, cached_num_change; @@ -2351,9 +2354,6 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) db_make_null (&class_name_val); db_make_null (&abs_inc_val); db_make_null (&range_val); - db_make_null (&serial_name_val); - db_make_null (&returnval); - db_make_null (&serial_owner_val); OID_SET_NULL (&serial_obj_id); /* @@ -2785,6 +2785,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) goto end; } pr_clear_value (&value); + opt_serial_option_list_flag = true; } /* increment_val */ @@ -2795,6 +2796,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) { goto end; } + opt_serial_option_list_flag = true; } /* max_val */ @@ -2805,6 +2807,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) { goto end; } + opt_serial_option_list_flag = true; } /* min_val */ @@ -2815,6 +2818,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) { goto end; } + opt_serial_option_list_flag = true; } /* cyclic */ @@ -2827,6 +2831,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) goto end; } pr_clear_value (&value); + opt_serial_option_list_flag = true; } /* cached num */ @@ -2853,25 +2858,35 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) goto end; } pr_clear_value (&value); + opt_serial_option_list_flag = true; } /* owner to */ serial_owner = statement->info.serial.owner_name; if (serial_owner != NULL) { + serial_name = (char *) PT_NODE_SR_NAME (statement); serial_owner_name = serial_owner->info.name.original; - db_make_string (&serial_name_val, (char *) PT_NODE_SR_NAME (statement)); - db_make_string (&serial_owner_val, serial_owner_name); - - au_change_serial_owner_method (serial_class, &returnval, &serial_name_val, &serial_owner_val); + sm_user_specified_name_for_serial (serial_name, user_specified_serial_name, DB_MAX_SERIAL_NAME_LENGTH); + serial_mop = do_get_serial_obj_id (&serial_obj_id, serial_class, user_specified_serial_name); + if (serial_mop == NULL) + { + ERROR_SET_ERROR_1ARG (error, ER_QPROC_SERIAL_NOT_FOUND, user_specified_serial_name); + goto end; + } - pr_clear_value (&serial_name_val); - pr_clear_value (&serial_owner_val); + owner_mop = au_find_user (serial_owner_name); + if (owner_mop == NULL) + { + ASSERT_ERROR_AND_SET (error); + goto end; + } - if (DB_VALUE_TYPE (&returnval) == DB_TYPE_ERROR) + error = au_change_serial_owner (serial_mop, owner_mop, false); + if (error != NO_ERROR) { - error = db_get_error (&returnval); + ASSERT_ERROR (); goto end; } } @@ -2902,7 +2917,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) obj_tmpl = NULL; end: - if (!OID_ISNULL (&serial_obj_id)) + if (!OID_ISNULL (&serial_obj_id) && opt_serial_option_list_flag == true) { (void) serial_decache ((OID *) (&serial_obj_id)); } From 9715b94ce095500e5fd755196f6551bd77f9454d Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Fri, 15 Mar 2024 09:29:31 +0900 Subject: [PATCH 03/21] Modified to the contents confirmed on 03/12 day, 1) style : change au_change_serial_owner() to au_change_serial_owner_method(), 2) style : changed permission-related error messages when changing serial owner --- src/object/authenticate.c | 10 ++++++++++ src/object/authenticate.h | 1 - src/query/execute_statement.c | 33 +++++++++++++-------------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index dabbe07fd59..312a74658f7 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -561,6 +561,9 @@ static int class_grant_loop (extract_context & ctxt, print_output & output_ctx, static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); +static void au_print_auth (MOP auth, FILE * fp); + +static int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); /* * DB_ EXTENSION FUNCTIONS @@ -5765,6 +5768,13 @@ au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial return; } + if (!au_is_dba_group_member (Au_user)) + { + ERROR_SET_WARNING_1ARG (error, ER_AU_DBA_ONLY, "change_serial_owner"); + db_make_error (return_val, error); + return; + } + if (!DB_IS_STRING (serial_val) || (serial_name = db_get_string (serial_val)) == NULL) { ERROR_SET_WARNING_1ARG (error, ER_OBJ_INVALID_ARGUMENT, ""); diff --git a/src/object/authenticate.h b/src/object/authenticate.h index 288ac93714a..6a2468b280d 100644 --- a/src/object/authenticate.h +++ b/src/object/authenticate.h @@ -236,7 +236,6 @@ extern int au_check_user (void); extern char *au_get_user_name (MOP obj); extern bool au_is_dba_group_member (MOP user); extern bool au_is_user_group_member (MOP group_user, MOP user); -extern int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); extern void au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial_val, DB_VALUE * owner_val); /* debugging functions */ diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index dc1d9730b12..f7058873f1c 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2320,9 +2320,8 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) int ret_msg_id = 0; PT_NODE *serial_owner = NULL; - const char *serial_name = NULL, *serial_owner_name = NULL; - char user_specified_serial_name[DB_MAX_SERIAL_NAME_LENGTH] = { '\0' }; - MOP serial_mop = NULL, owner_mop = NULL; + const char *serial_owner_name = NULL; + DB_VALUE serial_name_val, returnval, serial_owner_val; const char *comment = NULL; bool opt_serial_option_list_flag = false; @@ -2354,6 +2353,9 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) db_make_null (&class_name_val); db_make_null (&abs_inc_val); db_make_null (&range_val); + db_make_null (&serial_name_val); + db_make_null (&returnval); + db_make_null (&serial_owner_val); OID_SET_NULL (&serial_obj_id); /* @@ -2865,28 +2867,19 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) serial_owner = statement->info.serial.owner_name; if (serial_owner != NULL) { - serial_name = (char *) PT_NODE_SR_NAME (statement); serial_owner_name = serial_owner->info.name.original; - sm_user_specified_name_for_serial (serial_name, user_specified_serial_name, DB_MAX_SERIAL_NAME_LENGTH); - serial_mop = do_get_serial_obj_id (&serial_obj_id, serial_class, user_specified_serial_name); - if (serial_mop == NULL) - { - ERROR_SET_ERROR_1ARG (error, ER_QPROC_SERIAL_NOT_FOUND, user_specified_serial_name); - goto end; - } + db_make_string (&serial_name_val, (char *) PT_NODE_SR_NAME (statement)); + db_make_string (&serial_owner_val, serial_owner_name); - owner_mop = au_find_user (serial_owner_name); - if (owner_mop == NULL) - { - ASSERT_ERROR_AND_SET (error); - goto end; - } + au_change_serial_owner_method (serial_class, &returnval, &serial_name_val, &serial_owner_val); - error = au_change_serial_owner (serial_mop, owner_mop, false); - if (error != NO_ERROR) + pr_clear_value (&serial_name_val); + pr_clear_value (&serial_owner_val); + + if (DB_VALUE_TYPE (&returnval) == DB_TYPE_ERROR) { - ASSERT_ERROR (); + error = db_get_error (&returnval); goto end; } } From 83dcf82ddef9e9f83b8c06ffe5b95439b7593e77 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Fri, 15 Mar 2024 09:36:06 +0900 Subject: [PATCH 04/21] style : Modify the authenticate.c file line --- src/object/authenticate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 312a74658f7..e7c744427db 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -564,7 +564,6 @@ static void au_print_auth (MOP auth, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); static int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); - /* * DB_ EXTENSION FUNCTIONS */ From 3f38dfb73610e3f88bbfe452896db449af07bb7a Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Fri, 15 Mar 2024 09:41:04 +0900 Subject: [PATCH 05/21] style : Correct error in authenticate.c file --- src/object/authenticate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index e7c744427db..f34a118fb61 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -561,7 +561,6 @@ static int class_grant_loop (extract_context & ctxt, print_output & output_ctx, static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); -static void au_print_auth (MOP auth, FILE * fp); static int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); /* From 44445ae649e706ce87e76533fb818d2476093d51 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 2 Apr 2024 17:11:13 +0900 Subject: [PATCH 06/21] feat : Added semantic_check logic and error message MSGCAT_SET_PARSER_SEMANTIC(317) in PT_ALTER_SERIAL, style : Added node->info.serial.code to PT_ALTER_SERIAL syntax --- msg/de_DE.utf8/cubrid.msg | 1 + msg/en_US.utf8/cubrid.msg | 1 + msg/en_US/cubrid.msg | 3 +- msg/es_ES.utf8/cubrid.msg | 1 + msg/fr_FR.utf8/cubrid.msg | 1 + msg/it_IT.utf8/cubrid.msg | 1 + msg/ja_JP.utf8/cubrid.msg | 1 + msg/km_KH.utf8/cubrid.msg | 1 + msg/ko_KR.euckr/cubrid.msg | 1 + msg/ko_KR.utf8/cubrid.msg | 1 + msg/ro_RO.utf8/cubrid.msg | 1 + msg/tr_TR.utf8/cubrid.msg | 1 + msg/vi_VN.utf8/cubrid.msg | 1 + msg/zh_CN.utf8/cubrid.msg | 1 + src/object/authenticate.c | 7 -- src/parser/csql_grammar.y | 19 +++- src/parser/parse_tree.h | 5 +- src/parser/parse_tree_cl.c | 147 ++++++++++++++++----------- src/parser/parser_message.h | 1 + src/parser/semantic_check.c | 120 ++++++++++++++++++++++ src/query/execute_statement.c | 182 ++++++++++++++++++++-------------- 21 files changed, 347 insertions(+), 150 deletions(-) diff --git a/msg/de_DE.utf8/cubrid.msg b/msg/de_DE.utf8/cubrid.msg index 6bdfa12e374..95a467b419c 100644 --- a/msg/de_DE.utf8/cubrid.msg +++ b/msg/de_DE.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Außer virtuellem Speicher: %1$d Bytes können nicht zugewiesen werden. diff --git a/msg/en_US.utf8/cubrid.msg b/msg/en_US.utf8/cubrid.msg index 406dfc61edd..e425d462461 100644 --- a/msg/en_US.utf8/cubrid.msg +++ b/msg/en_US.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index a374f63c74e..75591387143 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1187,7 +1187,7 @@ $ LOADDB 1117 Cannot change attribute "%1$s". CUBRID cannot change an attribute as a SHARED and vice versa. 1118 The argument of "%1$s" can not be coerced to desired domain "%2$s". 1119 Internal error: Page id %1$d is allocated according to the allocation map of volume "%2$s", but it does not belong to any file. -1120 Internal error: Page id %1$d of volume "%2$s" is currently being used, but it is not allocated according to the allocation map of volume. +1120 Internal error: Page id %1$d of volume "%2$s" is currently being use140d, but it is not allocated according to the allocation map of volume. 1121 NOT NULL constraints do not allow NULL value. 1122 Time out in receiving data. 1123 pthread_cond_timedwait() timed out. @@ -1931,6 +1931,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/es_ES.utf8/cubrid.msg b/msg/es_ES.utf8/cubrid.msg index 6b041d5690c..41b8d66ed8f 100644 --- a/msg/es_ES.utf8/cubrid.msg +++ b/msg/es_ES.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sin memoria virtual: incapaz de asignar %1$d bytes. diff --git a/msg/fr_FR.utf8/cubrid.msg b/msg/fr_FR.utf8/cubrid.msg index 97d482d6881..718d80e75b2 100644 --- a/msg/fr_FR.utf8/cubrid.msg +++ b/msg/fr_FR.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Mémoire virtuelle épuisée: impossible d'allouer %1$d octets. diff --git a/msg/it_IT.utf8/cubrid.msg b/msg/it_IT.utf8/cubrid.msg index fc1e77f23d7..51e89034b7a 100644 --- a/msg/it_IT.utf8/cubrid.msg +++ b/msg/it_IT.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Fuori di memoria virtuale: Impossibile allocare %1$d byte. diff --git a/msg/ja_JP.utf8/cubrid.msg b/msg/ja_JP.utf8/cubrid.msg index 944c3abd574..0f13e4f3d38 100644 --- a/msg/ja_JP.utf8/cubrid.msg +++ b/msg/ja_JP.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 バチャールメモリーが足りません。: %1$dバイトがアロケーションできません。 diff --git a/msg/km_KH.utf8/cubrid.msg b/msg/km_KH.utf8/cubrid.msg index 7072353024e..7bba8424ae7 100644 --- a/msg/km_KH.utf8/cubrid.msg +++ b/msg/km_KH.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index f00cb98177e..a0735ae4ece 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Ǿ "%1$s"() ʽϴ. 315 ̸ ٲٱ ڸ ϴ. 316 ̸ ٲٱ ̸ ϴ. +317 DBA DBA ׷ %1$s() ֽϴ. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 ޸ : %1$d Ʈ Ҵ ϴ. diff --git a/msg/ko_KR.utf8/cubrid.msg b/msg/ko_KR.utf8/cubrid.msg index b947be8afcd..94de13c20b7 100644 --- a/msg/ko_KR.utf8/cubrid.msg +++ b/msg/ko_KR.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 동의어 "%1$s"이(가) 존재하지 않습니다. 315 이름 바꾸기는 소유자를 변경할 수 없습니다. 316 이름 바꾸기는 같은 이름으로 변경할 수 없습니다. +317 DBA 및 DBA 그룹의 구성원은 %1$s을(를) 수행할 수 있습니다. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 가상 메모리 없음: %1$d 바이트를 할당할 수 없습니다. diff --git a/msg/ro_RO.utf8/cubrid.msg b/msg/ro_RO.utf8/cubrid.msg index c49db51dc57..1a7289e9fcf 100644 --- a/msg/ro_RO.utf8/cubrid.msg +++ b/msg/ro_RO.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Memorie virtuală epuizată: nu s-au putut aloca %1$d bytes. diff --git a/msg/tr_TR.utf8/cubrid.msg b/msg/tr_TR.utf8/cubrid.msg index 621f66ba7a8..92872977686 100644 --- a/msg/tr_TR.utf8/cubrid.msg +++ b/msg/tr_TR.utf8/cubrid.msg @@ -1930,6 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sanal bellek yetersiz: %1$d bayt bölüm ayıramadı. diff --git a/msg/vi_VN.utf8/cubrid.msg b/msg/vi_VN.utf8/cubrid.msg index 1592070be66..262a36418c6 100644 --- a/msg/vi_VN.utf8/cubrid.msg +++ b/msg/vi_VN.utf8/cubrid.msg @@ -1937,6 +1937,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/zh_CN.utf8/cubrid.msg b/msg/zh_CN.utf8/cubrid.msg index db33d149f4e..83657b86f25 100644 --- a/msg/zh_CN.utf8/cubrid.msg +++ b/msg/zh_CN.utf8/cubrid.msg @@ -1931,6 +1931,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. +317 DBA and members of DBA group can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 虚拟内存耗尽: 无法申请 %1$d 字节. diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 6c913c0e69b..1f5e38555db 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -5254,13 +5254,6 @@ au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial return; } - if (!au_is_dba_group_member (Au_user)) - { - ERROR_SET_WARNING_1ARG (error, ER_AU_DBA_ONLY, "change_serial_owner"); - db_make_error (return_val, error); - return; - } - if (!DB_IS_STRING (serial_val) || (serial_name = db_get_string (serial_val)) == NULL) { ERROR_SET_WARNING_1ARG (error, ER_OBJ_INVALID_ARGUMENT, ""); diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index b5ea483a9e2..4b918cfec77 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3757,6 +3757,7 @@ alter_stmt node->info.serial.cached_num_val = cached_num_val; node->info.serial.no_cache = no_cache; node->info.serial.comment = comment; + node->info.serial.code = PT_SERIAL_OPTION; } $$ = node; @@ -3764,11 +3765,12 @@ alter_stmt if (!start_val && !increment_val && !max_val && !min_val && cyclic == 0 && no_max == 0 && no_min == 0 - && no_cyclic == 0 && !cached_num_val && no_cache == 0 - && comment == NULL) + && no_cyclic == 0 && !cached_num_val && no_cache == 0) { - PT_ERRORmf (this_parser, node, MSGCAT_SET_PARSER_SEMANTIC, - MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); + if (comment != NULL) + { + node->info.serial.code = PT_SERIAL_COMMENT; + } } DBG_PRINT}} @@ -3786,11 +3788,20 @@ alter_stmt node->info.serial.serial_name = $3; node->info.serial.owner_name = $6; node->info.serial.comment = $7; + node->info.serial.code = PT_CHANGE_OWNER; } $$ = node; PARSER_SAVE_ERR_CONTEXT ($$, @$.buffer_pos) + if (node->info.serial.owner_name == NULL) + { + if (node->info.serial.comment != NULL) + { + node->info.serial.code = PT_SERIAL_COMMENT; + } + } + DBG_PRINT}} | ALTER /* 1 */ { /* 2 */ diff --git a/src/parser/parse_tree.h b/src/parser/parse_tree.h index 15ebc96b9ea..780e0f9391f 100644 --- a/src/parser/parse_tree.h +++ b/src/parser/parse_tree.h @@ -1443,7 +1443,9 @@ typedef enum PT_CHANGE_INDEX_COMMENT, PT_CHANGE_INDEX_STATUS, PT_ADD_MEMBERS, /* alter user type */ - PT_DROP_MEMBERS + PT_DROP_MEMBERS, + PT_SERIAL_OPTION, /* alter serial type */ + PT_SERIAL_COMMENT } PT_ALTER_CODE; /* Codes for trigger event type */ @@ -2180,6 +2182,7 @@ struct pt_serial_info PT_NODE *cached_num_val; /* PT_VALUE */ PT_NODE *owner_name; /* PT_NAME */ PT_NODE *comment; /* PT_VALUE */ + PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER, PT_SERIAL_COMMENT */ int cyclic; int no_max; int no_min; diff --git a/src/parser/parse_tree_cl.c b/src/parser/parse_tree_cl.c index a1eb1f037f5..d5c899f37a2 100644 --- a/src/parser/parse_tree_cl.c +++ b/src/parser/parse_tree_cl.c @@ -8103,74 +8103,101 @@ pt_print_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p) q = pt_append_nulstring (parser, q, "alter serial "); q = pt_append_varchar (parser, q, r1); - if (p->info.serial.start_val != NULL) + switch (p->info.serial.code) { - r1 = pt_print_bytes (parser, p->info.serial.start_val); - q = pt_append_nulstring (parser, q, " start with "); - q = pt_append_varchar (parser, q, r1); - } + case PT_SERIAL_OPTION: + if (p->info.serial.start_val != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.start_val); + q = pt_append_nulstring (parser, q, " start with "); + q = pt_append_varchar (parser, q, r1); + } - if (p->info.serial.increment_val) - { - r1 = pt_print_bytes (parser, p->info.serial.increment_val); - q = pt_append_nulstring (parser, q, " increment by "); - q = pt_append_varchar (parser, q, r1); - } + if (p->info.serial.increment_val) + { + r1 = pt_print_bytes (parser, p->info.serial.increment_val); + q = pt_append_nulstring (parser, q, " increment by "); + q = pt_append_varchar (parser, q, r1); + } - if (p->info.serial.min_val) - { - r1 = pt_print_bytes (parser, p->info.serial.min_val); - q = pt_append_nulstring (parser, q, " minvalue "); - q = pt_append_varchar (parser, q, r1); - } - else if (p->info.serial.no_min == 1) - { - q = pt_append_nulstring (parser, q, " nomaxvalue "); - } + if (p->info.serial.min_val) + { + r1 = pt_print_bytes (parser, p->info.serial.min_val); + q = pt_append_nulstring (parser, q, " minvalue "); + q = pt_append_varchar (parser, q, r1); + } + else if (p->info.serial.no_min == 1) + { + q = pt_append_nulstring (parser, q, " nomaxvalue "); + } - if (p->info.serial.max_val) - { - r1 = pt_print_bytes (parser, p->info.serial.max_val); - q = pt_append_nulstring (parser, q, " maxvalue "); - q = pt_append_varchar (parser, q, r1); - } - else if (p->info.serial.no_max == 1) - { - q = pt_append_nulstring (parser, q, " nomaxvalue "); - } + if (p->info.serial.max_val) + { + r1 = pt_print_bytes (parser, p->info.serial.max_val); + q = pt_append_nulstring (parser, q, " maxvalue "); + q = pt_append_varchar (parser, q, r1); + } + else if (p->info.serial.no_max == 1) + { + q = pt_append_nulstring (parser, q, " nomaxvalue "); + } - if (p->info.serial.cyclic) - { - q = pt_append_nulstring (parser, q, " cycle "); - } - else if (p->info.serial.no_cyclic == 1) - { - q = pt_append_nulstring (parser, q, " nocycle "); - } + if (p->info.serial.cyclic) + { + q = pt_append_nulstring (parser, q, " cycle "); + } + else if (p->info.serial.no_cyclic == 1) + { + q = pt_append_nulstring (parser, q, " nocycle "); + } - if (p->info.serial.cached_num_val && p->info.serial.no_cache != 1) - { - r1 = pt_print_bytes (parser, p->info.serial.cached_num_val); - q = pt_append_nulstring (parser, q, " cache "); - q = pt_append_varchar (parser, q, r1); - } - else if (p->info.serial.no_cache != 0) - { - q = pt_append_nulstring (parser, q, " nocache "); - } + if (p->info.serial.cached_num_val && p->info.serial.no_cache != 1) + { + r1 = pt_print_bytes (parser, p->info.serial.cached_num_val); + q = pt_append_nulstring (parser, q, " cache "); + q = pt_append_varchar (parser, q, r1); + } + else if (p->info.serial.no_cache != 0) + { + q = pt_append_nulstring (parser, q, " nocache "); + } - if (p->info.serial.owner_name != NULL) - { - r1 = pt_print_bytes (parser, p->info.serial.owner_name); - q = pt_append_nulstring (parser, q, " owner to "); - q = pt_append_varchar (parser, q, r1); - } + if (p->info.serial.comment != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.comment); + q = pt_append_nulstring (parser, q, " comment "); + q = pt_append_varchar (parser, q, r1); + } + break; - if (p->info.serial.comment != NULL) - { - r1 = pt_print_bytes (parser, p->info.serial.comment); - q = pt_append_nulstring (parser, q, " comment "); - q = pt_append_varchar (parser, q, r1); + case PT_CHANGE_OWNER: + if (p->info.serial.owner_name != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.owner_name); + q = pt_append_nulstring (parser, q, " owner to "); + q = pt_append_varchar (parser, q, r1); + } + + if (p->info.serial.comment != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.comment); + q = pt_append_nulstring (parser, q, " comment "); + q = pt_append_varchar (parser, q, r1); + } + break; + + case PT_SERIAL_COMMENT: + if (p->info.serial.comment != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.comment); + q = pt_append_nulstring (parser, q, " comment "); + q = pt_append_varchar (parser, q, r1); + } + break; + + default: + assert (false); + break; } return q; diff --git a/src/parser/parser_message.h b/src/parser/parser_message.h index 0e7e534fb89..24af448391c 100644 --- a/src/parser/parser_message.h +++ b/src/parser/parser_message.h @@ -493,6 +493,7 @@ #define MSGCAT_SEMANTIC_SYNONYM_NOT_EXIST MSGCAT_SEMANTIC_NO(314) #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_CHANGE_OWNER MSGCAT_SEMANTIC_NO(315) #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_SAME_NAME MSGCAT_SEMANTIC_NO(316) +#define MSGCAT_SEMANTIC_SERIAL_NOT_OWNER MSGCAT_SEMANTIC_NO(317) /* Message id in the set MSGCAT_SET_PARSER_RUNTIME */ #define MSGCAT_RUNTIME_NO(n) n diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index 69607c6a2fd..9a70694fc3d 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -34,6 +34,7 @@ #include "memory_alloc.h" #include "jsp_cl.h" #include "execute_schema.h" +#include "execute_statement.h" #include "set_object.h" #include "schema_manager.h" #include "release_string.h" @@ -202,6 +203,7 @@ static void pt_check_grant_revoke (PARSER_CONTEXT * parser, PT_NODE * node); static void pt_check_method (PARSER_CONTEXT * parser, PT_NODE * node); static void pt_check_truncate (PARSER_CONTEXT * parser, PT_NODE * node); static void pt_check_kill (PARSER_CONTEXT * parser, PT_NODE * node); +static void pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node); static void pt_check_update_stats (PARSER_CONTEXT * parser, PT_NODE * node); static PT_NODE *pt_check_single_valued_node (PARSER_CONTEXT * parser, PT_NODE * node, void *arg, int *continue_walk); static PT_NODE *pt_check_single_valued_node_post (PARSER_CONTEXT * parser, PT_NODE * node, void *arg, @@ -9928,6 +9930,122 @@ pt_check_kill (PARSER_CONTEXT * parser, PT_NODE * node) } } +/* + * pt_check_alter_serial () - do semantic checks on the alter serial statement + * return: none + * parser(in): the parser context used to derive the statement + * node(in): a statement + */ +static void +pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) +{ + DB_OBJECT *serial_class = NULL, *serial_object = NULL; + DB_IDENTIFIER serial_obj_id; + DB_OBJECT *owner_object = NULL; + PT_NODE *start_val = NULL; + PT_NODE *increment_val = NULL; + PT_NODE *max_val = NULL; + PT_NODE *min_val = NULL; + int cyclic; + int no_max; + int no_min; + int no_cyclic; + PT_NODE *cached_num_val = NULL; + int no_cache; + const char *name = NULL; + const char *owner_name = NULL; + + OID_SET_NULL (&serial_obj_id); + + assert (node->node_type == PT_ALTER_SERIAL); + + /* find db_serial_class */ + serial_class = sm_find_class (CT_SERIAL_NAME); + if (serial_class == NULL) + { + er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_QPROC_DB_SERIAL_NOT_FOUND, 0); + return; + } + + /* serial_name */ + name = node->info.serial.serial_name->info.name.original; + if (serial_class == NULL) + { + assert (sm_check_system_class_by_name (name)); + } + + /* Check if a serial object exists. */ + serial_object = do_get_serial_obj_id (&serial_obj_id, serial_class, name); + if (serial_object == NULL) + { + er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_QPROC_SERIAL_NOT_FOUND, 1, name); + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_RUNTIME, MSGCAT_RUNTIME_RT_SERIAL_NOT_DEFINED, name); + return; + } + + assert (node->info.serial.code != NULL); + switch (node->info.serial.code) + { + case PT_SERIAL_OPTION: + start_val = node->info.serial.start_val; + increment_val = node->info.serial.increment_val; + max_val = node->info.serial.max_val; + min_val = node->info.serial.min_val; + cyclic = node->info.serial.cyclic; + no_max = node->info.serial.no_max; + no_min = node->info.serial.no_min; + no_cyclic = node->info.serial.no_cyclic; + cached_num_val = node->info.serial.cached_num_val; + no_cache = node->info.serial.no_cache; + + if (!start_val && !increment_val && !max_val && !min_val + && cyclic == 0 && no_max == 0 && no_min == 0 + && no_cyclic == 0 && !cached_num_val && no_cache == 0 + && owner_name == NULL && node->info.serial.comment == NULL) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); + return; + } + break; + + case PT_CHANGE_OWNER: + if (node->info.serial.owner_name == NULL && node->info.serial.comment == NULL) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); + return; + } + + /* serial_owner_name */ + owner_name = node->info.serial.owner_name->info.name.original; + assert (owner_name != NULL && *owner_name != '\0'); + owner_object = db_find_user (owner_name); + if (owner_object == NULL) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_USER_IS_NOT_IN_DB, owner_name); + return; + } + + if (au_is_dba_group_member (Au_user) == false) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_NOT_OWNER, + "change_serial_owner"); + return; + } + break; + + case PT_SERIAL_COMMENT: + if (node->info.serial.comment == NULL) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); + return; + } + break; + default: + assert (false); + break; + } +} + /* * pt_check_update_stats () - do semantic checks on the UPDATE STATISTICS statement * return: none @@ -11858,6 +11976,8 @@ pt_check_with_info (PARSER_CONTEXT * parser, PT_NODE * node, SEMANTIC_CHK_INFO * break; case PT_ALTER_SERIAL: + pt_check_alter_serial (parser, node); + break; case PT_ALTER_TRIGGER: case PT_ALTER_USER: case PT_CREATE_SERIAL: diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index 92e7d952471..8496044e3d3 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2319,12 +2319,11 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) int cached_num; int ret_msg_id = 0; - PT_NODE *serial_owner = NULL; const char *serial_owner_name = NULL; DB_VALUE serial_name_val, returnval, serial_owner_val; const char *comment = NULL; - bool opt_serial_option_list_flag = false; + const PT_ALTER_CODE alter_serial_code = statement->info.serial.code; int new_inc_val_flag = 0, new_cyclic; bool cur_val_change, inc_val_change, max_val_change, min_val_change, cyclic_change, cached_num_change; @@ -2771,103 +2770,114 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) goto end; } - /* current_val */ - if (cur_val_change) + switch (alter_serial_code) { - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CURRENT_VAL, &start_val); - if (error < 0) + case PT_SERIAL_OPTION: + /* current_val */ + if (cur_val_change) { - goto end; + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CURRENT_VAL, &start_val); + if (error < 0) + { + goto end; + } + /* reset started flag because current_val changed */ + db_make_int (&value, 0); + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_STARTED, &value); + if (error < 0) + { + goto end; + } + pr_clear_value (&value); } - /* reset started flag because current_val changed */ - db_make_int (&value, 0); - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_STARTED, &value); - if (error < 0) + + /* increment_val */ + if (inc_val_change) { - goto end; + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_INCREMENT_VAL, &new_inc_val); + if (error < 0) + { + goto end; + } } - pr_clear_value (&value); - opt_serial_option_list_flag = true; - } - /* increment_val */ - if (inc_val_change) - { - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_INCREMENT_VAL, &new_inc_val); - if (error < 0) + /* max_val */ + if (max_val_change) { - goto end; + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_MAX_VAL, &new_max_val); + if (error < 0) + { + goto end; + } } - opt_serial_option_list_flag = true; - } - /* max_val */ - if (max_val_change) - { - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_MAX_VAL, &new_max_val); - if (error < 0) + /* min_val */ + if (min_val_change) { - goto end; + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_MIN_VAL, &new_min_val); + if (error < 0) + { + goto end; + } } - opt_serial_option_list_flag = true; - } - /* min_val */ - if (min_val_change) - { - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_MIN_VAL, &new_min_val); - if (error < 0) + /* cyclic */ + if (cyclic_change) { - goto end; + db_make_int (&value, new_cyclic); + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CYCLIC, &value); + if (error < 0) + { + goto end; + } + pr_clear_value (&value); } - opt_serial_option_list_flag = true; - } - /* cyclic */ - if (cyclic_change) - { - db_make_int (&value, new_cyclic); - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CYCLIC, &value); - if (error < 0) + /* cached num */ + if (cached_num_change) { - goto end; - } - pr_clear_value (&value); - opt_serial_option_list_flag = true; - } - /* cached num */ - if (cached_num_change) - { + /* Here we need class_name and att_name to see if this serial is auto_increment. Cause for an auto_increment + * serial, it is not allowed to change the cached_num for it. */ + if (!DB_IS_NULL (&class_name_val)) + { - /* Here we need class_name and att_name to see if this serial is auto_increment. Cause for an auto_increment - * serial, it is not allowed to change the cached_num for it. */ - if (!DB_IS_NULL (&class_name_val)) - { + error = MSGCAT_RUNTIME_INVALID_AUTO_INCREMENT_ALTER; - error = MSGCAT_RUNTIME_INVALID_AUTO_INCREMENT_ALTER; + PT_ERRORmf (parser, statement, MSGCAT_SET_PARSER_RUNTIME, error, name); - PT_ERRORmf (parser, statement, MSGCAT_SET_PARSER_RUNTIME, error, name); + goto end; - goto end; + } + db_make_int (&value, cached_num); + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CACHED_NUM, &value); + if (error < 0) + { + goto end; + } + pr_clear_value (&value); } - db_make_int (&value, cached_num); - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_CACHED_NUM, &value); - if (error < 0) + /* comment */ + if (statement->info.serial.comment != NULL) { - goto end; + assert (statement->info.serial.comment->node_type == PT_VALUE); + comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); + db_make_string (&value, comment); + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_COMMENT, &value); + pr_clear_value (&value); + if (error < 0) + { + goto end; + } } - pr_clear_value (&value); - opt_serial_option_list_flag = true; - } + break; - /* owner to */ - serial_owner = statement->info.serial.owner_name; - if (serial_owner != NULL) - { - serial_owner_name = serial_owner->info.name.original; + case PT_CHANGE_OWNER: + /* owner to */ + assert (statement->info.serial.owner_name != NULL); + serial_owner_name = statement->info.serial.owner_name->info.name.original; db_make_string (&serial_name_val, (char *) PT_NODE_SR_NAME (statement)); db_make_string (&serial_owner_val, serial_owner_name); @@ -2882,11 +2892,24 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) error = db_get_error (&returnval); goto end; } - } - /* comment */ - if (statement->info.serial.comment != NULL) - { + /* comment */ + if (statement->info.serial.comment != NULL) + { + assert (statement->info.serial.comment->node_type == PT_VALUE); + comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); + db_make_string (&value, comment); + error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_COMMENT, &value); + pr_clear_value (&value); + if (error < 0) + { + goto end; + } + } + break; + + case PT_SERIAL_COMMENT: + /* comment */ assert (statement->info.serial.comment->node_type == PT_VALUE); comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); db_make_string (&value, comment); @@ -2896,6 +2919,11 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) { goto end; } + break; + + default: + assert (false); + break; } serial_object = dbt_finish_object (obj_tmpl); @@ -2910,7 +2938,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) obj_tmpl = NULL; end: - if (!OID_ISNULL (&serial_obj_id) && opt_serial_option_list_flag == true) + if (!OID_ISNULL (&serial_obj_id) && alter_serial_code == PT_SERIAL_OPTION) { (void) serial_decache ((OID *) (&serial_obj_id)); } From 18ec8b8540a970a80ab56c63f87fa7431709be57 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 2 Apr 2024 17:46:01 +0900 Subject: [PATCH 07/21] Correction of typos --- msg/en_US/cubrid.msg | 2 +- src/parser/csql_grammar.y | 35 +++++++++++++++++------------------ src/parser/semantic_check.c | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index 75591387143..3aacf6a7678 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1187,7 +1187,7 @@ $ LOADDB 1117 Cannot change attribute "%1$s". CUBRID cannot change an attribute as a SHARED and vice versa. 1118 The argument of "%1$s" can not be coerced to desired domain "%2$s". 1119 Internal error: Page id %1$d is allocated according to the allocation map of volume "%2$s", but it does not belong to any file. -1120 Internal error: Page id %1$d of volume "%2$s" is currently being use140d, but it is not allocated according to the allocation map of volume. +1120 Internal error: Page id %1$d of volume "%2$s" is currently being used, but it is not allocated according to the allocation map of volume. 1121 NOT NULL constraints do not allow NULL value. 1122 Time out in receiving data. 1123 pthread_cond_timedwait() timed out. diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index 4b918cfec77..2fd288f7aad 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3781,27 +3781,26 @@ alter_stmt opt_comment_spec /* 7 */ {{ DBG_TRACE_GRAMMAR(alter_stmt, | ALTER SERIAL serial_name OWNER TO identifier opt_comment_spec); - PT_NODE *node = parser_new_node (this_parser, PT_ALTER_SERIAL); + PT_NODE *node = parser_new_node (this_parser, PT_ALTER_SERIAL); - if (node) - { - node->info.serial.serial_name = $3; - node->info.serial.owner_name = $6; - node->info.serial.comment = $7; - node->info.serial.code = PT_CHANGE_OWNER; - } - - $$ = node; - PARSER_SAVE_ERR_CONTEXT ($$, @$.buffer_pos) + if (node) + { + node->info.serial.serial_name = $3; + node->info.serial.owner_name = $6; + node->info.serial.comment = $7; + node->info.serial.code = PT_CHANGE_OWNER; + } - if (node->info.serial.owner_name == NULL) - { - if (node->info.serial.comment != NULL) - { - node->info.serial.code = PT_SERIAL_COMMENT; - } - } + $$ = node; + PARSER_SAVE_ERR_CONTEXT ($$, @$.buffer_pos) + if (node->info.serial.owner_name == NULL) + { + if (node->info.serial.comment != NULL) + { + node->info.serial.code = PT_SERIAL_COMMENT; + } + } DBG_PRINT}} | ALTER /* 1 */ { /* 2 */ diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index 9a70694fc3d..7725b7ccdeb 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -9969,7 +9969,7 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) /* serial_name */ name = node->info.serial.serial_name->info.name.original; - if (serial_class == NULL) + if (name == NULL) { assert (sm_check_system_class_by_name (name)); } From 0fc408bb8e12204e9d8a9a24411ddbc0479dff55 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Thu, 11 Apr 2024 13:03:21 +0900 Subject: [PATCH 08/21] style: Change au_change_serial_owner() to au_change_serial_owner_method() --- src/object/authenticate.c | 1 - src/object/authenticate.h | 1 + src/query/execute_statement.c | 33 ++++++++++++++++++++------------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 79df2965620..356faed04ed 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -465,7 +465,6 @@ static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); -static int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); static int au_delete_auth_of_dropping_user (MOP user); /* diff --git a/src/object/authenticate.h b/src/object/authenticate.h index 3aeb6039340..0075a29d0af 100644 --- a/src/object/authenticate.h +++ b/src/object/authenticate.h @@ -249,6 +249,7 @@ extern int au_check_user (void); extern char *au_get_user_name (MOP obj); extern bool au_is_dba_group_member (MOP user); extern bool au_is_user_group_member (MOP group_user, MOP user); +extern int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); extern void au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial_val, DB_VALUE * owner_val); /* debugging functions */ diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index 8496044e3d3..090ed1afb50 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2319,8 +2319,9 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) int cached_num; int ret_msg_id = 0; - const char *serial_owner_name = NULL; - DB_VALUE serial_name_val, returnval, serial_owner_val; + const char *serial_name = NULL, *serial_owner_name = NULL; + char user_specified_serial_name[DB_MAX_SERIAL_NAME_LENGTH] = { '\0' }; + MOP serial_mop = NULL, owner_mop = NULL; const char *comment = NULL; const PT_ALTER_CODE alter_serial_code = statement->info.serial.code; @@ -2352,9 +2353,6 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) db_make_null (&class_name_val); db_make_null (&abs_inc_val); db_make_null (&range_val); - db_make_null (&serial_name_val); - db_make_null (&returnval); - db_make_null (&serial_owner_val); OID_SET_NULL (&serial_obj_id); /* @@ -2877,19 +2875,28 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) case PT_CHANGE_OWNER: /* owner to */ assert (statement->info.serial.owner_name != NULL); + serial_name = (char *) PT_NODE_SR_NAME (statement); serial_owner_name = statement->info.serial.owner_name->info.name.original; - db_make_string (&serial_name_val, (char *) PT_NODE_SR_NAME (statement)); - db_make_string (&serial_owner_val, serial_owner_name); - - au_change_serial_owner_method (serial_class, &returnval, &serial_name_val, &serial_owner_val); + sm_user_specified_name_for_serial (serial_name, user_specified_serial_name, DB_MAX_SERIAL_NAME_LENGTH); + serial_mop = do_get_serial_obj_id (&serial_obj_id, serial_class, user_specified_serial_name); + if (serial_mop == NULL) + { + ERROR_SET_ERROR_1ARG (error, ER_QPROC_SERIAL_NOT_FOUND, user_specified_serial_name); + goto end; + } - pr_clear_value (&serial_name_val); - pr_clear_value (&serial_owner_val); + owner_mop = au_find_user (serial_owner_name); + if (owner_mop == NULL) + { + ASSERT_ERROR_AND_SET (error); + goto end; + } - if (DB_VALUE_TYPE (&returnval) == DB_TYPE_ERROR) + error = au_change_serial_owner (serial_mop, owner_mop, false); + if (error != NO_ERROR) { - error = db_get_error (&returnval); + ASSERT_ERROR (); goto end; } From 2de54d104269488db4905e6eec1b80b8a7c65d2e Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Thu, 11 Apr 2024 14:31:05 +0900 Subject: [PATCH 09/21] style: Fixed PT_CHANGE_OWNER conditional check inside semantic_check --- src/parser/semantic_check.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index 7725b7ccdeb..3ca6c3c9617 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -10000,8 +10000,7 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) if (!start_val && !increment_val && !max_val && !min_val && cyclic == 0 && no_max == 0 && no_min == 0 - && no_cyclic == 0 && !cached_num_val && no_cache == 0 - && owner_name == NULL && node->info.serial.comment == NULL) + && no_cyclic == 0 && !cached_num_val && no_cache == 0 && node->info.serial.comment == NULL) { PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); return; From c0047b2a875351edde79703cc2c8fa6186047c00 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Fri, 12 Apr 2024 16:33:49 +0900 Subject: [PATCH 10/21] style: Re-registering where error message text is broken --- msg/de_DE.utf8/cubrid.msg | 2 +- msg/en_US.utf8/cubrid.msg | 2 +- msg/en_US/cubrid.msg | 2 +- msg/es_ES.utf8/cubrid.msg | 2 +- msg/fr_FR.utf8/cubrid.msg | 2 +- msg/it_IT.utf8/cubrid.msg | 2 +- msg/ja_JP.utf8/cubrid.msg | 2 +- msg/km_KH.utf8/cubrid.msg | 2 +- msg/ko_KR.utf8/cubrid.msg | 2 +- msg/ro_RO.utf8/cubrid.msg | 2 +- msg/tr_TR.utf8/cubrid.msg | 2 +- msg/vi_VN.utf8/cubrid.msg | 2 +- msg/zh_CN.utf8/cubrid.msg | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/msg/de_DE.utf8/cubrid.msg b/msg/de_DE.utf8/cubrid.msg index 95a467b419c..c02773c8cbe 100644 --- a/msg/de_DE.utf8/cubrid.msg +++ b/msg/de_DE.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Außer virtuellem Speicher: %1$d Bytes können nicht zugewiesen werden. diff --git a/msg/en_US.utf8/cubrid.msg b/msg/en_US.utf8/cubrid.msg index e425d462461..0f023145575 100644 --- a/msg/en_US.utf8/cubrid.msg +++ b/msg/en_US.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index 3aacf6a7678..fe5713e07a6 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1931,7 +1931,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/es_ES.utf8/cubrid.msg b/msg/es_ES.utf8/cubrid.msg index 41b8d66ed8f..7189a48f0a6 100644 --- a/msg/es_ES.utf8/cubrid.msg +++ b/msg/es_ES.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sin memoria virtual: incapaz de asignar %1$d bytes. diff --git a/msg/fr_FR.utf8/cubrid.msg b/msg/fr_FR.utf8/cubrid.msg index 718d80e75b2..f9a6bad58fc 100644 --- a/msg/fr_FR.utf8/cubrid.msg +++ b/msg/fr_FR.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Mémoire virtuelle épuisée: impossible d'allouer %1$d octets. diff --git a/msg/it_IT.utf8/cubrid.msg b/msg/it_IT.utf8/cubrid.msg index 51e89034b7a..715d580d2a0 100644 --- a/msg/it_IT.utf8/cubrid.msg +++ b/msg/it_IT.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Fuori di memoria virtuale: Impossibile allocare %1$d byte. diff --git a/msg/ja_JP.utf8/cubrid.msg b/msg/ja_JP.utf8/cubrid.msg index 0f13e4f3d38..d9a332e8954 100644 --- a/msg/ja_JP.utf8/cubrid.msg +++ b/msg/ja_JP.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 バチャールメモリーが足りません。: %1$dバイトがアロケーションできません。 diff --git a/msg/km_KH.utf8/cubrid.msg b/msg/km_KH.utf8/cubrid.msg index 7bba8424ae7..545f2967239 100644 --- a/msg/km_KH.utf8/cubrid.msg +++ b/msg/km_KH.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/ko_KR.utf8/cubrid.msg b/msg/ko_KR.utf8/cubrid.msg index 94de13c20b7..586e37c0b1d 100644 --- a/msg/ko_KR.utf8/cubrid.msg +++ b/msg/ko_KR.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 동의어 "%1$s"이(가) 존재하지 않습니다. 315 이름 바꾸기는 소유자를 변경할 수 없습니다. 316 이름 바꾸기는 같은 이름으로 변경할 수 없습니다. -317 DBA 및 DBA 그룹의 구성원은 %1$s을(를) 수행할 수 있습니다. +317 DBA 및 DBA 그룹 구성원만 %1$s을(를) 수행할 수 있습니다. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 가상 메모리 없음: %1$d 바이트를 할당할 수 없습니다. diff --git a/msg/ro_RO.utf8/cubrid.msg b/msg/ro_RO.utf8/cubrid.msg index 1a7289e9fcf..eb2151f3fc3 100644 --- a/msg/ro_RO.utf8/cubrid.msg +++ b/msg/ro_RO.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Memorie virtuală epuizată: nu s-au putut aloca %1$d bytes. diff --git a/msg/tr_TR.utf8/cubrid.msg b/msg/tr_TR.utf8/cubrid.msg index 92872977686..0f28052c6de 100644 --- a/msg/tr_TR.utf8/cubrid.msg +++ b/msg/tr_TR.utf8/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sanal bellek yetersiz: %1$d bayt bölüm ayıramadı. diff --git a/msg/vi_VN.utf8/cubrid.msg b/msg/vi_VN.utf8/cubrid.msg index 262a36418c6..23d083f3e35 100644 --- a/msg/vi_VN.utf8/cubrid.msg +++ b/msg/vi_VN.utf8/cubrid.msg @@ -1937,7 +1937,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/zh_CN.utf8/cubrid.msg b/msg/zh_CN.utf8/cubrid.msg index 83657b86f25..e885698942a 100644 --- a/msg/zh_CN.utf8/cubrid.msg +++ b/msg/zh_CN.utf8/cubrid.msg @@ -1931,7 +1931,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 DBA and members of DBA group can perform %1$s. +317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 虚拟内存耗尽: 无法申请 %1$d 字节. From 0086df5f611ed097d28e1f30b6e4744f1d6e6851 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Fri, 12 Apr 2024 16:49:59 +0900 Subject: [PATCH 11/21] style: Re-registering where error message text is broken (ko_KR.euckr) --- msg/ko_KR.euckr/cubrid.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index a0735ae4ece..df48e30a592 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -1930,7 +1930,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Ǿ "%1$s"() ʽϴ. 315 ̸ ٲٱ ڸ ϴ. 316 ̸ ٲٱ ̸ ϴ. -317 DBA DBA ׷ %1$s() ֽϴ. +317 DBA DBA ׷ %1$s() ֽϴ. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 ޸ : %1$d Ʈ Ҵ ϴ. From 43dc688710bbb8b29712f3e39c8ac85b7fd29de4 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 00:56:22 +0900 Subject: [PATCH 12/21] Crash actions --- msg/de_DE.utf8/cubrid.msg | 1 - msg/en_US.utf8/cubrid.msg | 1 - msg/en_US/cubrid.msg | 1 - msg/es_ES.utf8/cubrid.msg | 1 - msg/fr_FR.utf8/cubrid.msg | 1 - msg/it_IT.utf8/cubrid.msg | 1 - msg/ja_JP.utf8/cubrid.msg | 1 - msg/km_KH.utf8/cubrid.msg | 1 - msg/ko_KR.euckr/cubrid.msg | 11 +++++------ msg/ko_KR.utf8/cubrid.msg | 1 - msg/ro_RO.utf8/cubrid.msg | 1 - msg/tr_TR.utf8/cubrid.msg | 1 - msg/vi_VN.utf8/cubrid.msg | 1 - msg/zh_CN.utf8/cubrid.msg | 1 - src/object/authenticate.c | 1 - src/object/authenticate.h | 2 -- src/parser/parser_message.h | 1 - 17 files changed, 5 insertions(+), 23 deletions(-) diff --git a/msg/de_DE.utf8/cubrid.msg b/msg/de_DE.utf8/cubrid.msg index c02773c8cbe..6bdfa12e374 100644 --- a/msg/de_DE.utf8/cubrid.msg +++ b/msg/de_DE.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Außer virtuellem Speicher: %1$d Bytes können nicht zugewiesen werden. diff --git a/msg/en_US.utf8/cubrid.msg b/msg/en_US.utf8/cubrid.msg index 0f023145575..406dfc61edd 100644 --- a/msg/en_US.utf8/cubrid.msg +++ b/msg/en_US.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index fe5713e07a6..a374f63c74e 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1931,7 +1931,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/es_ES.utf8/cubrid.msg b/msg/es_ES.utf8/cubrid.msg index 7189a48f0a6..6b041d5690c 100644 --- a/msg/es_ES.utf8/cubrid.msg +++ b/msg/es_ES.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sin memoria virtual: incapaz de asignar %1$d bytes. diff --git a/msg/fr_FR.utf8/cubrid.msg b/msg/fr_FR.utf8/cubrid.msg index f9a6bad58fc..97d482d6881 100644 --- a/msg/fr_FR.utf8/cubrid.msg +++ b/msg/fr_FR.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Mémoire virtuelle épuisée: impossible d'allouer %1$d octets. diff --git a/msg/it_IT.utf8/cubrid.msg b/msg/it_IT.utf8/cubrid.msg index 715d580d2a0..fc1e77f23d7 100644 --- a/msg/it_IT.utf8/cubrid.msg +++ b/msg/it_IT.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Fuori di memoria virtuale: Impossibile allocare %1$d byte. diff --git a/msg/ja_JP.utf8/cubrid.msg b/msg/ja_JP.utf8/cubrid.msg index d9a332e8954..944c3abd574 100644 --- a/msg/ja_JP.utf8/cubrid.msg +++ b/msg/ja_JP.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 バチャールメモリーが足りません。: %1$dバイトがアロケーションできません。 diff --git a/msg/km_KH.utf8/cubrid.msg b/msg/km_KH.utf8/cubrid.msg index 545f2967239..7072353024e 100644 --- a/msg/km_KH.utf8/cubrid.msg +++ b/msg/km_KH.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index df48e30a592..d0d6d96ff6a 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -185,7 +185,7 @@ $set 5 MSGCAT_SET_ERROR 116 ͺ̽ "%1$s" () ų, "databases.txt" ׼ ϴ. 117 ͺ̽ ΰ ʹ ϴ. "%1$s" ̸ "%2$s"() ̴ %3$d , ̴ %4$d ۾ƾ մϴ. 118 ۾ ͸ ϴ. -119 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +119 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 120 ִ (%1$d) ʰ߽ϴ. 121 ͺ̽ "%1$s"() Ϸ մϴ. 122 ý ޽ īŻα׸ ϴ. @@ -416,7 +416,7 @@ $set 5 MSGCAT_SET_ERROR 347 master pipe ϴ. 348 service Ʈ ȣ ؾ մϴ. 349 TCP Դϴ: %1$s. -350 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +350 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 351 TCP socket ϴ. 352 tcp_open: TCP Ʈ ϴ. 353 ȣƮ "%1$s" master ϴ. @@ -683,8 +683,8 @@ $ LOADDB 613 ٸǷ Ŭ "%3$s" "%1$s"() Ŭ "%2$s" alias substitute Ȱ ϴ. 614 α ִġ %1$d() ʰ߽ϴ. 615 ϴ. : %1$d. -616 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. -617 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +616 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +617 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 618 ƮƮ ϴ. 619 ߸ ڵԴϴ. 620 ȯ ڵ ߸Ǿϴ. @@ -1313,7 +1313,7 @@ $ LOADDB 1243 ؼ ε ε ҵǾϴ. 1244 shared Ӽ Ʈ CS 忡 ε ϴ. 1245 class Ӽ Ʈ CS 忡 ε ϴ. -1246 "%2$s" ȣƮ ("%1$s") Ȯ ϴ. Ǵ ȣƮ ִ Ȯּ. +1246 "%2$s"? ȣƮ ("%1$s") Ȯ ϴ. Ǵ ȣƮ ִ Ȯּ. 1247 (%1$s) ݵ (%2$s) ķ ؾ մϴ. 1248 ùٸ Ű ƴմϴ. : %1$s 1249 Ű ã ϴ (ε: %1$d). @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Ǿ "%1$s"() ʽϴ. 315 ̸ ٲٱ ڸ ϴ. 316 ̸ ٲٱ ̸ ϴ. -317 DBA DBA ׷ %1$s() ֽϴ. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 ޸ : %1$d Ʈ Ҵ ϴ. diff --git a/msg/ko_KR.utf8/cubrid.msg b/msg/ko_KR.utf8/cubrid.msg index 586e37c0b1d..b947be8afcd 100644 --- a/msg/ko_KR.utf8/cubrid.msg +++ b/msg/ko_KR.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 동의어 "%1$s"이(가) 존재하지 않습니다. 315 이름 바꾸기는 소유자를 변경할 수 없습니다. 316 이름 바꾸기는 같은 이름으로 변경할 수 없습니다. -317 DBA 및 DBA 그룹 구성원만 %1$s을(를) 수행할 수 있습니다. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 가상 메모리 없음: %1$d 바이트를 할당할 수 없습니다. diff --git a/msg/ro_RO.utf8/cubrid.msg b/msg/ro_RO.utf8/cubrid.msg index eb2151f3fc3..c49db51dc57 100644 --- a/msg/ro_RO.utf8/cubrid.msg +++ b/msg/ro_RO.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Memorie virtuală epuizată: nu s-au putut aloca %1$d bytes. diff --git a/msg/tr_TR.utf8/cubrid.msg b/msg/tr_TR.utf8/cubrid.msg index 0f28052c6de..621f66ba7a8 100644 --- a/msg/tr_TR.utf8/cubrid.msg +++ b/msg/tr_TR.utf8/cubrid.msg @@ -1930,7 +1930,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sanal bellek yetersiz: %1$d bayt bölüm ayıramadı. diff --git a/msg/vi_VN.utf8/cubrid.msg b/msg/vi_VN.utf8/cubrid.msg index 23d083f3e35..1592070be66 100644 --- a/msg/vi_VN.utf8/cubrid.msg +++ b/msg/vi_VN.utf8/cubrid.msg @@ -1937,7 +1937,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/zh_CN.utf8/cubrid.msg b/msg/zh_CN.utf8/cubrid.msg index e885698942a..db33d149f4e 100644 --- a/msg/zh_CN.utf8/cubrid.msg +++ b/msg/zh_CN.utf8/cubrid.msg @@ -1931,7 +1931,6 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 314 Synonym "%1$s" does not exist. 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. -317 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 虚拟内存耗尽: 无法申请 %1$d 字节. diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 356faed04ed..83eb7933928 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -465,7 +465,6 @@ static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); -static int au_delete_auth_of_dropping_user (MOP user); /* * DB_ EXTENSION FUNCTIONS diff --git a/src/object/authenticate.h b/src/object/authenticate.h index 0075a29d0af..0cd523abca3 100644 --- a/src/object/authenticate.h +++ b/src/object/authenticate.h @@ -249,8 +249,6 @@ extern int au_check_user (void); extern char *au_get_user_name (MOP obj); extern bool au_is_dba_group_member (MOP user); extern bool au_is_user_group_member (MOP group_user, MOP user); -extern int au_change_serial_owner (MOP serial_mop, MOP owner_mop, bool by_class_owner_change); -extern void au_change_serial_owner_method (MOP obj, DB_VALUE * return_val, DB_VALUE * serial_val, DB_VALUE * owner_val); /* debugging functions */ extern void au_dump (void); diff --git a/src/parser/parser_message.h b/src/parser/parser_message.h index 24af448391c..0e7e534fb89 100644 --- a/src/parser/parser_message.h +++ b/src/parser/parser_message.h @@ -493,7 +493,6 @@ #define MSGCAT_SEMANTIC_SYNONYM_NOT_EXIST MSGCAT_SEMANTIC_NO(314) #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_CHANGE_OWNER MSGCAT_SEMANTIC_NO(315) #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_SAME_NAME MSGCAT_SEMANTIC_NO(316) -#define MSGCAT_SEMANTIC_SERIAL_NOT_OWNER MSGCAT_SEMANTIC_NO(317) /* Message id in the set MSGCAT_SET_PARSER_RUNTIME */ #define MSGCAT_RUNTIME_NO(n) n From a824ba6aedc3ea97bf98208309b5522ec31285e5 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 00:58:28 +0900 Subject: [PATCH 13/21] Crash actions --- src/object/authenticate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 83eb7933928..8241ca545e3 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -466,6 +466,7 @@ static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); + /* * DB_ EXTENSION FUNCTIONS */ From c853e9716a47884a8d62b1b4904a1bb29125ac42 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 01:00:04 +0900 Subject: [PATCH 14/21] Crash actions(3) --- src/object/authenticate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 8241ca545e3..95937679c1b 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -467,6 +467,9 @@ static void au_print_auth (MOP auth, FILE * fp); + + + /* * DB_ EXTENSION FUNCTIONS */ From 3206bab02be7cee72db7d2c00f74affa3769e017 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 01:01:18 +0900 Subject: [PATCH 15/21] Crash actions(4) --- src/object/authenticate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/object/authenticate.c b/src/object/authenticate.c index 95937679c1b..ea7b765f50a 100644 --- a/src/object/authenticate.c +++ b/src/object/authenticate.c @@ -465,11 +465,6 @@ static void au_print_cache (int cache, FILE * fp); static void au_print_grant_entry (DB_SET * grants, int grant_index, FILE * fp); static void au_print_auth (MOP auth, FILE * fp); - - - - - /* * DB_ EXTENSION FUNCTIONS */ From 6f33842ee4f898398c9dbd789521b99c228a431d Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 01:43:52 +0900 Subject: [PATCH 16/21] 1) feat : Add container_11(c1 ~ c11), 2) style : Change opt_serial_option_list to opt_serial_option_list_or_owner_clause --- msg/de_DE.utf8/cubrid.msg | 1 + msg/en_US.utf8/cubrid.msg | 1 + msg/en_US/cubrid.msg | 1 + msg/es_ES.utf8/cubrid.msg | 1 + msg/fr_FR.utf8/cubrid.msg | 1 + msg/it_IT.utf8/cubrid.msg | 1 + msg/ja_JP.utf8/cubrid.msg | 1 + msg/km_KH.utf8/cubrid.msg | 1 + msg/ko_KR.euckr/cubrid.msg | 1 + msg/ko_KR.utf8/cubrid.msg | 1 + msg/ro_RO.utf8/cubrid.msg | 1 + msg/tr_TR.utf8/cubrid.msg | 1 + msg/vi_VN.utf8/cubrid.msg | 1 + msg/zh_CN.utf8/cubrid.msg | 1 + src/parser/csql_grammar.y | 139 ++++++++++++++++++++++++++---------- src/parser/parser_message.h | 1 + 16 files changed, 115 insertions(+), 39 deletions(-) diff --git a/msg/de_DE.utf8/cubrid.msg b/msg/de_DE.utf8/cubrid.msg index 1fb6a8f1114..abc562ed839 100644 --- a/msg/de_DE.utf8/cubrid.msg +++ b/msg/de_DE.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Außer virtuellem Speicher: %1$d Bytes können nicht zugewiesen werden. diff --git a/msg/en_US.utf8/cubrid.msg b/msg/en_US.utf8/cubrid.msg index 29ee3cafd22..d3f25362585 100644 --- a/msg/en_US.utf8/cubrid.msg +++ b/msg/en_US.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index dacb8ee924f..b3324830455 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1933,6 +1933,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/es_ES.utf8/cubrid.msg b/msg/es_ES.utf8/cubrid.msg index 28477edff4e..771127ebd57 100644 --- a/msg/es_ES.utf8/cubrid.msg +++ b/msg/es_ES.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sin memoria virtual: incapaz de asignar %1$d bytes. diff --git a/msg/fr_FR.utf8/cubrid.msg b/msg/fr_FR.utf8/cubrid.msg index 4a7bfcf03b0..c3a93840ce3 100644 --- a/msg/fr_FR.utf8/cubrid.msg +++ b/msg/fr_FR.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Mémoire virtuelle épuisée: impossible d'allouer %1$d octets. diff --git a/msg/it_IT.utf8/cubrid.msg b/msg/it_IT.utf8/cubrid.msg index dac6ef310b9..881cd19d7ca 100644 --- a/msg/it_IT.utf8/cubrid.msg +++ b/msg/it_IT.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Fuori di memoria virtuale: Impossibile allocare %1$d byte. diff --git a/msg/ja_JP.utf8/cubrid.msg b/msg/ja_JP.utf8/cubrid.msg index 4f693b70096..4a9a81a3a6e 100644 --- a/msg/ja_JP.utf8/cubrid.msg +++ b/msg/ja_JP.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 バチャールメモリーが足りません。: %1$dバイトがアロケーションできません。 diff --git a/msg/km_KH.utf8/cubrid.msg b/msg/km_KH.utf8/cubrid.msg index c7c699208a3..bfd717895cd 100644 --- a/msg/km_KH.utf8/cubrid.msg +++ b/msg/km_KH.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index f3decdae3c9..d86f7967bb9 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 ̸ ٲٱ ڸ ϴ. 316 ̸ ٲٱ ̸ ϴ. 317 ĺڴ LIMIT ȿ ϴ. +318 DBA DBA ׷ %1$s() ֽϴ. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 ޸ : %1$d Ʈ Ҵ ϴ. diff --git a/msg/ko_KR.utf8/cubrid.msg b/msg/ko_KR.utf8/cubrid.msg index e3e32c456bb..329923e542e 100644 --- a/msg/ko_KR.utf8/cubrid.msg +++ b/msg/ko_KR.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 이름 바꾸기는 소유자를 변경할 수 없습니다. 316 이름 바꾸기는 같은 이름으로 변경할 수 없습니다. 317 식별자는 LIMIT 절 안에 있을 수 없습니다. +318 DBA 및 DBA 그룹 구성원만 %1$s을(를) 수행할 수 있습니다. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 가상 메모리 없음: %1$d 바이트를 할당할 수 없습니다. diff --git a/msg/ro_RO.utf8/cubrid.msg b/msg/ro_RO.utf8/cubrid.msg index 46d111804dc..ac38a044572 100644 --- a/msg/ro_RO.utf8/cubrid.msg +++ b/msg/ro_RO.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Memorie virtuală epuizată: nu s-au putut aloca %1$d bytes. diff --git a/msg/tr_TR.utf8/cubrid.msg b/msg/tr_TR.utf8/cubrid.msg index 10e179ea88c..a750f64decb 100644 --- a/msg/tr_TR.utf8/cubrid.msg +++ b/msg/tr_TR.utf8/cubrid.msg @@ -1932,6 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sanal bellek yetersiz: %1$d bayt bölüm ayıramadı. diff --git a/msg/vi_VN.utf8/cubrid.msg b/msg/vi_VN.utf8/cubrid.msg index 4ba4950ea02..2e6dbc82ff7 100644 --- a/msg/vi_VN.utf8/cubrid.msg +++ b/msg/vi_VN.utf8/cubrid.msg @@ -1939,6 +1939,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/zh_CN.utf8/cubrid.msg b/msg/zh_CN.utf8/cubrid.msg index 97c91fc89f2..36a9b14b151 100644 --- a/msg/zh_CN.utf8/cubrid.msg +++ b/msg/zh_CN.utf8/cubrid.msg @@ -1933,6 +1933,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. +318 Only DBA and DBA group members can perform %1$s. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 虚拟内存耗尽: 无法申请 %1$d 字节. diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index f19156417e1..577033fd29d 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -77,6 +77,21 @@ typedef struct PT_NODE *c10; } container_10; +typedef struct +{ + PT_NODE *c1; + PT_NODE *c2; + PT_NODE *c3; + PT_NODE *c4; + PT_NODE *c5; + PT_NODE *c6; + PT_NODE *c7; + PT_NODE *c8; + PT_NODE *c9; + PT_NODE *c10; + PT_NODE *c11; +} container_11; + void csql_yyerror_explicit (int line, int column); void csql_yyerror (const char *s); @@ -264,6 +279,7 @@ static bool is_in_create_trigger = false; #define CONTAINER_AT_7(a) (a).c8 #define CONTAINER_AT_8(a) (a).c9 #define CONTAINER_AT_9(a) (a).c10 +#define CONTAINER_AT_10(a) (a).c11 #define YEN_SIGN_TEXT "(\0xa1\0xef)" #define DOLLAR_SIGN_TEXT "$" @@ -304,6 +320,7 @@ typedef enum SERIAL_MIN, SERIAL_CYCLE, SERIAL_CACHE, + SERIAL_CHANGE_OWNER, } SERIAL_DEFINE; typedef enum @@ -551,6 +568,7 @@ static char *g_plcsql_text; container_3 c3; container_4 c4; container_10 c10; + container_11 c11; struct json_table_column_behavior jtcb; } @@ -1025,8 +1043,10 @@ static char *g_plcsql_text; /* define rule type (container) */ /*{{{*/ -%type opt_serial_option_list -%type serial_option_list +%type opt_serial_option_list +%type serial_option_list +%type opt_serial_option_list_or_owner_clause +%type serial_owner_clause %type connect_info %type alter_server_list @@ -1038,6 +1058,7 @@ static char *g_plcsql_text; %type ref_rule_list %type opt_ref_rule_list %type of_serial_option +%type of_serial_owner_clause %type delete_from_using %type trigger_status_or_priority_or_change_owner @@ -3285,8 +3306,8 @@ class_name_for_synonym opt_serial_option_list : /* empty */ {{ DBG_TRACE_GRAMMAR(opt_serial_option_list, : ); - container_10 ctn; - memset(&ctn, 0x00, sizeof(container_10)); + container_11 ctn; + memset(&ctn, 0x00, sizeof(container_11)); $$ = ctn; }} | serial_option_list @@ -3295,6 +3316,23 @@ opt_serial_option_list }} ; +opt_serial_option_list_or_owner_clause + : /* empty */ + {{ DBG_TRACE_GRAMMAR(opt_serial_option_list_or_owner_clause, : ); + container_11 ctn; + memset(&ctn, 0x00, sizeof(container_11)); + $$ = ctn; + }} + | serial_option_list + {{ DBG_TRACE_GRAMMAR(opt_serial_option_list_or_owner_clause, | serial_option_list); + $$ = $1; + }} + | serial_owner_clause + {{ DBG_TRACE_GRAMMAR(opt_serial_option_list_or_owner_clause, | serial_owner_clause); + $$ = $1; + }} + ; + serial_option_list : serial_option_list of_serial_option {{ DBG_TRACE_GRAMMAR(serial_option_list, : serial_option_list of_serial_option); @@ -3316,7 +3354,7 @@ serial_option_list * 10: no_cache, */ - container_10 ctn = $1; + container_11 ctn = $1; PT_NODE* node = pt_top(this_parser); PARSER_SAVE_ERR_CONTEXT (node, @$.buffer_pos) @@ -3411,8 +3449,8 @@ serial_option_list * 10: no_cache, */ - container_10 ctn; - memset(&ctn, 0x00, sizeof(container_10)); + container_11 ctn; + memset(&ctn, 0x00, sizeof(container_11)); switch(TO_NUMBER (CONTAINER_AT_0($1))) { @@ -3489,6 +3527,51 @@ of_serial_option DBG_PRINT}} ; +serial_owner_clause + : of_serial_owner_clause + {{ DBG_TRACE_GRAMMAR(serial_owner_clause, : of_serial_owner_clause); + /* container order + * 1: start_val + * + * 2: increment_val, + * + * 3: max_val, + * 4: no_max, + * + * 5: min_val, + * 6: no_min, + * + * 7: cyclic, + * 8: no_cyclic, + * + * 9: cached_num_val, + * 10: no_cache, + * 11: owner, + */ + + container_11 ctn; + memset(&ctn, 0x00, sizeof(container_11)); + + switch(TO_NUMBER (CONTAINER_AT_0($1))) + { + case SERIAL_CHANGE_OWNER: + ctn.c11 = CONTAINER_AT_1($1); + break; + } + + $$ = ctn; + + DBG_PRINT}} + ; + +of_serial_owner_clause + : OWNER TO identifier + {{ DBG_TRACE_GRAMMAR(of_serial_owner_clause, : OWNER TO identifier); + container_3 ctn; + SET_CONTAINER_3(ctn, FROM_NUMBER(SERIAL_CHANGE_OWNER), $3, NULL); + $$ = ctn; + DBG_PRINT}} + ; opt_replace : /* empty */ @@ -3735,9 +3818,9 @@ alter_stmt | ALTER /* 1 */ SERIAL /* 2 */ serial_name /* 3 */ - opt_serial_option_list /* 4 */ + opt_serial_option_list_or_owner_clause /* 4 */ opt_comment_spec /* 5 */ - {{ DBG_TRACE_GRAMMAR(alter_stmt, | ALTER SERIAL serial_name opt_serial_option_list opt_comment_spec); + {{ DBG_TRACE_GRAMMAR(alter_stmt, | ALTER SERIAL serial_name opt_serial_option_list_or_owner_clause opt_comment_spec); /* container order * 0: start_val * 1: increment_val, @@ -3749,6 +3832,7 @@ alter_stmt * 7: no_cyclic, * 8: cached_num_val, * 9: no_cache, + * 10: owner, */ PT_NODE *serial_name = $3; @@ -3762,6 +3846,7 @@ alter_stmt int no_cyclic = (int) TO_NUMBER (CONTAINER_AT_7 ($4)); PT_NODE *cached_num_val = CONTAINER_AT_8 ($4); int no_cache = (int) TO_NUMBER (CONTAINER_AT_9 ($4)); + PT_NODE *owner_name = CONTAINER_AT_10 ($4); PT_NODE *comment = $5; PT_NODE *node = parser_new_node (this_parser, PT_ALTER_SERIAL); @@ -3778,6 +3863,7 @@ alter_stmt node->info.serial.no_cyclic = no_cyclic; node->info.serial.cached_num_val = cached_num_val; node->info.serial.no_cache = no_cache; + node->info.serial.owner_name = owner_name; node->info.serial.comment = comment; node->info.serial.code = PT_SERIAL_OPTION; } @@ -3789,40 +3875,15 @@ alter_stmt && cyclic == 0 && no_max == 0 && no_min == 0 && no_cyclic == 0 && !cached_num_val && no_cache == 0) { - if (comment != NULL) + if (owner_name != NULL) { - node->info.serial.code = PT_SERIAL_COMMENT; + node->info.serial.code = PT_CHANGE_OWNER; } - } - - DBG_PRINT}} - | ALTER /* 1 */ - SERIAL /* 2 */ - serial_name /* 3 */ - OWNER TO identifier /* 4, 5, 6 */ - opt_comment_spec /* 7 */ - {{ DBG_TRACE_GRAMMAR(alter_stmt, | ALTER SERIAL serial_name OWNER TO identifier opt_comment_spec); - - PT_NODE *node = parser_new_node (this_parser, PT_ALTER_SERIAL); - - if (node) - { - node->info.serial.serial_name = $3; - node->info.serial.owner_name = $6; - node->info.serial.comment = $7; - node->info.serial.code = PT_CHANGE_OWNER; - } - - $$ = node; - PARSER_SAVE_ERR_CONTEXT ($$, @$.buffer_pos) - - if (node->info.serial.owner_name == NULL) - { - if (node->info.serial.comment != NULL) - { + else if (comment != NULL) + { node->info.serial.code = PT_SERIAL_COMMENT; } - } + } DBG_PRINT}} | ALTER /* 1 */ { /* 2 */ diff --git a/src/parser/parser_message.h b/src/parser/parser_message.h index 5247dde0957..aa843ccbbea 100644 --- a/src/parser/parser_message.h +++ b/src/parser/parser_message.h @@ -494,6 +494,7 @@ #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_CHANGE_OWNER MSGCAT_SEMANTIC_NO(315) #define MSGCAT_SEMANTIC_SYNONYM_RENAME_CANNOT_SAME_NAME MSGCAT_SEMANTIC_NO(316) #define MSGCAT_SEMANTIC_IDENTIFIER_IN_LIMIT_CLAUSE MSGCAT_SEMANTIC_NO(317) +#define MSGCAT_SEMANTIC_SERIAL_NOT_OWNER MSGCAT_SEMANTIC_NO(318) /* Message id in the set MSGCAT_SET_PARSER_RUNTIME */ #define MSGCAT_RUNTIME_NO(n) n From 6e4e9864f6a9bfa8acb7a100990dc9e0ef5892e3 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 23 Apr 2024 10:44:36 +0900 Subject: [PATCH 17/21] style: Re-registering where error message text is broken (ko_KR.euckr) --- msg/ko_KR.euckr/cubrid.msg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index d86f7967bb9..fae34b4b198 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -185,7 +185,7 @@ $set 5 MSGCAT_SET_ERROR 116 ͺ̽ "%1$s" () ų, "databases.txt" ׼ ϴ. 117 ͺ̽ ΰ ʹ ϴ. "%1$s" ̸ "%2$s"() ̴ %3$d , ̴ %4$d ۾ƾ մϴ. 118 ۾ ͸ ϴ. -119 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +119 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 120 ִ (%1$d) ʰ߽ϴ. 121 ͺ̽ "%1$s"() Ϸ մϴ. 122 ý ޽ īŻα׸ ϴ. @@ -416,7 +416,7 @@ $set 5 MSGCAT_SET_ERROR 347 master pipe ϴ. 348 service Ʈ ȣ ؾ մϴ. 349 TCP Դϴ: %1$s. -350 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +350 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 351 TCP socket ϴ. 352 tcp_open: TCP Ʈ ϴ. 353 ȣƮ "%1$s" master ϴ. @@ -683,8 +683,8 @@ $ LOADDB 613 ٸǷ Ŭ "%3$s" "%1$s"() Ŭ "%2$s" alias substitute Ȱ ϴ. 614 α ִġ %1$d() ʰ߽ϴ. 615 ϴ. : %1$d. -616 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. -617 "%2$s"? ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +616 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. +617 "%2$s" ȣƮ ("%1$s") ã ϴ. Ǵ ȣƮ ִ Ȯּ. 618 ƮƮ ϴ. 619 ߸ ڵԴϴ. 620 ȯ ڵ ߸Ǿϴ. @@ -1313,7 +1313,7 @@ $ LOADDB 1243 ؼ ε ε ҵǾϴ. 1244 shared Ӽ Ʈ CS 忡 ε ϴ. 1245 class Ӽ Ʈ CS 忡 ε ϴ. -1246 "%2$s"? ȣƮ ("%1$s") Ȯ ϴ. Ǵ ȣƮ ִ Ȯּ. +1246 "%2$s" ȣƮ ("%1$s") Ȯ ϴ. Ǵ ȣƮ ִ Ȯּ. 1247 (%1$s) ݵ (%2$s) ķ ؾ մϴ. 1248 ùٸ Ű ƴմϴ. : %1$s 1249 Ű ã ϴ (ε: %1$d). From c3e11963ce8c0d5378c487014866a04188592119 Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Sun, 28 Apr 2024 23:22:13 +0900 Subject: [PATCH 18/21] 1) style: Deduplicate PT_SERIAL_COMMENT and COMMENT, 2) style : Returns the SERIAL_DECACHE function condition to its original state. --- src/parser/csql_grammar.y | 4 ---- src/parser/parse_tree.h | 5 ++-- src/parser/parse_tree_cl.c | 9 -------- src/parser/semantic_check.c | 7 ------ src/query/execute_statement.c | 43 +++++++---------------------------- 5 files changed, 10 insertions(+), 58 deletions(-) diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index 577033fd29d..b8f56726778 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3879,10 +3879,6 @@ alter_stmt { node->info.serial.code = PT_CHANGE_OWNER; } - else if (comment != NULL) - { - node->info.serial.code = PT_SERIAL_COMMENT; - } } DBG_PRINT}} | ALTER /* 1 */ diff --git a/src/parser/parse_tree.h b/src/parser/parse_tree.h index 935707e0e99..04b7b61ebd2 100644 --- a/src/parser/parse_tree.h +++ b/src/parser/parse_tree.h @@ -1445,8 +1445,7 @@ typedef enum PT_CHANGE_INDEX_STATUS, PT_ADD_MEMBERS, /* alter user type */ PT_DROP_MEMBERS, - PT_SERIAL_OPTION, /* alter serial type */ - PT_SERIAL_COMMENT + PT_SERIAL_OPTION /* alter serial type */ } PT_ALTER_CODE; /* Codes for trigger event type */ @@ -2184,7 +2183,7 @@ struct pt_serial_info PT_NODE *cached_num_val; /* PT_VALUE */ PT_NODE *owner_name; /* PT_NAME */ PT_NODE *comment; /* PT_VALUE */ - PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER, PT_SERIAL_COMMENT */ + PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER */ int cyclic; int no_max; int no_min; diff --git a/src/parser/parse_tree_cl.c b/src/parser/parse_tree_cl.c index 4187f3404e1..af97eabf0fb 100644 --- a/src/parser/parse_tree_cl.c +++ b/src/parser/parse_tree_cl.c @@ -8275,15 +8275,6 @@ pt_print_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p) } break; - case PT_SERIAL_COMMENT: - if (p->info.serial.comment != NULL) - { - r1 = pt_print_bytes (parser, p->info.serial.comment); - q = pt_append_nulstring (parser, q, " comment "); - q = pt_append_varchar (parser, q, r1); - } - break; - default: assert (false); break; diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index 9f4f0fcb5d4..c32ece74a90 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -10032,13 +10032,6 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) } break; - case PT_SERIAL_COMMENT: - if (node->info.serial.comment == NULL) - { - PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); - return; - } - break; default: assert (false); break; diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index db809512677..4e808c31abe 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2856,20 +2856,6 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) } pr_clear_value (&value); } - - /* comment */ - if (statement->info.serial.comment != NULL) - { - assert (statement->info.serial.comment->node_type == PT_VALUE); - comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); - db_make_string (&value, comment); - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_COMMENT, &value); - pr_clear_value (&value); - if (error < 0) - { - goto end; - } - } break; case PT_CHANGE_OWNER: @@ -2899,24 +2885,16 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) ASSERT_ERROR (); goto end; } + break; - /* comment */ - if (statement->info.serial.comment != NULL) - { - assert (statement->info.serial.comment->node_type == PT_VALUE); - comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); - db_make_string (&value, comment); - error = dbt_put_internal (obj_tmpl, SERIAL_ATTR_COMMENT, &value); - pr_clear_value (&value); - if (error < 0) - { - goto end; - } - } + default: + assert (false); break; + } - case PT_SERIAL_COMMENT: - /* comment */ + /* comment */ + if (statement->info.serial.comment != NULL) + { assert (statement->info.serial.comment->node_type == PT_VALUE); comment = (char *) PT_VALUE_GET_BYTES (statement->info.serial.comment); db_make_string (&value, comment); @@ -2926,11 +2904,6 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) { goto end; } - break; - - default: - assert (false); - break; } serial_object = dbt_finish_object (obj_tmpl); @@ -2945,7 +2918,7 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) obj_tmpl = NULL; end: - if (!OID_ISNULL (&serial_obj_id) && alter_serial_code == PT_SERIAL_OPTION) + if (!OID_ISNULL (&serial_obj_id)) { (void) serial_decache ((OID *) (&serial_obj_id)); } From 98e3a9c62d673b48ce8ada1dc972ef4dd98dacfb Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Mon, 29 Apr 2024 00:18:20 +0900 Subject: [PATCH 19/21] 1) style: Fixed to make it clear to users when changing the SERIAL OWNER. --- msg/de_DE.utf8/cubrid.msg | 2 +- msg/en_US.utf8/cubrid.msg | 2 +- msg/en_US/cubrid.msg | 2 +- msg/es_ES.utf8/cubrid.msg | 2 +- msg/fr_FR.utf8/cubrid.msg | 2 +- msg/it_IT.utf8/cubrid.msg | 2 +- msg/ja_JP.utf8/cubrid.msg | 2 +- msg/km_KH.utf8/cubrid.msg | 2 +- msg/ko_KR.euckr/cubrid.msg | 2 +- msg/ko_KR.utf8/cubrid.msg | 2 +- msg/ro_RO.utf8/cubrid.msg | 2 +- msg/tr_TR.utf8/cubrid.msg | 2 +- msg/vi_VN.utf8/cubrid.msg | 2 +- msg/zh_CN.utf8/cubrid.msg | 2 +- src/parser/semantic_check.c | 3 +-- 15 files changed, 15 insertions(+), 16 deletions(-) diff --git a/msg/de_DE.utf8/cubrid.msg b/msg/de_DE.utf8/cubrid.msg index abc562ed839..f6d19c860e4 100644 --- a/msg/de_DE.utf8/cubrid.msg +++ b/msg/de_DE.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Außer virtuellem Speicher: %1$d Bytes können nicht zugewiesen werden. diff --git a/msg/en_US.utf8/cubrid.msg b/msg/en_US.utf8/cubrid.msg index d3f25362585..f591a6bbd5a 100644 --- a/msg/en_US.utf8/cubrid.msg +++ b/msg/en_US.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/en_US/cubrid.msg b/msg/en_US/cubrid.msg index b3324830455..6c4c0e8e81d 100644 --- a/msg/en_US/cubrid.msg +++ b/msg/en_US/cubrid.msg @@ -1933,7 +1933,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/es_ES.utf8/cubrid.msg b/msg/es_ES.utf8/cubrid.msg index 771127ebd57..eb2b8ded4d3 100644 --- a/msg/es_ES.utf8/cubrid.msg +++ b/msg/es_ES.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sin memoria virtual: incapaz de asignar %1$d bytes. diff --git a/msg/fr_FR.utf8/cubrid.msg b/msg/fr_FR.utf8/cubrid.msg index c3a93840ce3..4e39d65ac97 100644 --- a/msg/fr_FR.utf8/cubrid.msg +++ b/msg/fr_FR.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Mémoire virtuelle épuisée: impossible d'allouer %1$d octets. diff --git a/msg/it_IT.utf8/cubrid.msg b/msg/it_IT.utf8/cubrid.msg index 881cd19d7ca..a874f30ce51 100644 --- a/msg/it_IT.utf8/cubrid.msg +++ b/msg/it_IT.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Fuori di memoria virtuale: Impossibile allocare %1$d byte. diff --git a/msg/ja_JP.utf8/cubrid.msg b/msg/ja_JP.utf8/cubrid.msg index 4a9a81a3a6e..e508e10711c 100644 --- a/msg/ja_JP.utf8/cubrid.msg +++ b/msg/ja_JP.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 バチャールメモリーが足りません。: %1$dバイトがアロケーションできません。 diff --git a/msg/km_KH.utf8/cubrid.msg b/msg/km_KH.utf8/cubrid.msg index bfd717895cd..8a16d944065 100644 --- a/msg/km_KH.utf8/cubrid.msg +++ b/msg/km_KH.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/ko_KR.euckr/cubrid.msg b/msg/ko_KR.euckr/cubrid.msg index fae34b4b198..8cf77b47752 100644 --- a/msg/ko_KR.euckr/cubrid.msg +++ b/msg/ko_KR.euckr/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 ̸ ٲٱ ڸ ϴ. 316 ̸ ٲٱ ̸ ϴ. 317 ĺڴ LIMIT ȿ ϴ. -318 DBA DBA ׷ %1$s() ֽϴ. +318 DBA DBA ׷ SERIAL OWNER ֽϴ. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 ޸ : %1$d Ʈ Ҵ ϴ. diff --git a/msg/ko_KR.utf8/cubrid.msg b/msg/ko_KR.utf8/cubrid.msg index 329923e542e..ed350dfaccc 100644 --- a/msg/ko_KR.utf8/cubrid.msg +++ b/msg/ko_KR.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 이름 바꾸기는 소유자를 변경할 수 없습니다. 316 이름 바꾸기는 같은 이름으로 변경할 수 없습니다. 317 식별자는 LIMIT 절 안에 있을 수 없습니다. -318 DBA 및 DBA 그룹 구성원만 %1$s을(를) 수행할 수 있습니다. +318 DBA 및 DBA 그룹 구성원만 SERIAL OWNER를 변경할 수 있습니다. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 가상 메모리 없음: %1$d 바이트를 할당할 수 없습니다. diff --git a/msg/ro_RO.utf8/cubrid.msg b/msg/ro_RO.utf8/cubrid.msg index ac38a044572..54f7400bedf 100644 --- a/msg/ro_RO.utf8/cubrid.msg +++ b/msg/ro_RO.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Memorie virtuală epuizată: nu s-au putut aloca %1$d bytes. diff --git a/msg/tr_TR.utf8/cubrid.msg b/msg/tr_TR.utf8/cubrid.msg index a750f64decb..163171ebc5d 100644 --- a/msg/tr_TR.utf8/cubrid.msg +++ b/msg/tr_TR.utf8/cubrid.msg @@ -1932,7 +1932,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Sanal bellek yetersiz: %1$d bayt bölüm ayıramadı. diff --git a/msg/vi_VN.utf8/cubrid.msg b/msg/vi_VN.utf8/cubrid.msg index 2e6dbc82ff7..7518c1194c9 100644 --- a/msg/vi_VN.utf8/cubrid.msg +++ b/msg/vi_VN.utf8/cubrid.msg @@ -1939,7 +1939,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 Out of virtual memory: unable to allocate %1$d bytes. diff --git a/msg/zh_CN.utf8/cubrid.msg b/msg/zh_CN.utf8/cubrid.msg index 36a9b14b151..238c908f064 100644 --- a/msg/zh_CN.utf8/cubrid.msg +++ b/msg/zh_CN.utf8/cubrid.msg @@ -1933,7 +1933,7 @@ $set 8 MSGCAT_SET_PARSER_SEMANTIC 315 Rename cannot change owner. 316 Rename cannot be changed to the same name. 317 Identifiers cannot be in a LIMIT clause. -318 Only DBA and DBA group members can perform %1$s. +318 Only DBA and DBA group members can change the SERIAL OWNER. $set 9 MSGCAT_SET_PARSER_RUNTIME 1 虚拟内存耗尽: 无法申请 %1$d 字节. diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index c32ece74a90..d0fc434233e 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -10026,8 +10026,7 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) if (au_is_dba_group_member (Au_user) == false) { - PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_NOT_OWNER, - "change_serial_owner"); + PT_ERRORm (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_NOT_OWNER); return; } break; From f6f7b74c0024d03b0805ed6f540f4adf62f6db4e Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Tue, 30 Apr 2024 00:36:28 +0900 Subject: [PATCH 20/21] style: Add PT_SERIAL_COMMENT again --- src/parser/csql_grammar.y | 4 ++++ src/parser/parse_tree.h | 5 +++-- src/parser/parse_tree_cl.c | 9 +++++++++ src/parser/semantic_check.c | 8 ++++++++ src/query/execute_statement.c | 4 ++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index b8f56726778..577033fd29d 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3879,6 +3879,10 @@ alter_stmt { node->info.serial.code = PT_CHANGE_OWNER; } + else if (comment != NULL) + { + node->info.serial.code = PT_SERIAL_COMMENT; + } } DBG_PRINT}} | ALTER /* 1 */ diff --git a/src/parser/parse_tree.h b/src/parser/parse_tree.h index 04b7b61ebd2..935707e0e99 100644 --- a/src/parser/parse_tree.h +++ b/src/parser/parse_tree.h @@ -1445,7 +1445,8 @@ typedef enum PT_CHANGE_INDEX_STATUS, PT_ADD_MEMBERS, /* alter user type */ PT_DROP_MEMBERS, - PT_SERIAL_OPTION /* alter serial type */ + PT_SERIAL_OPTION, /* alter serial type */ + PT_SERIAL_COMMENT } PT_ALTER_CODE; /* Codes for trigger event type */ @@ -2183,7 +2184,7 @@ struct pt_serial_info PT_NODE *cached_num_val; /* PT_VALUE */ PT_NODE *owner_name; /* PT_NAME */ PT_NODE *comment; /* PT_VALUE */ - PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER */ + PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER, PT_SERIAL_COMMENT */ int cyclic; int no_max; int no_min; diff --git a/src/parser/parse_tree_cl.c b/src/parser/parse_tree_cl.c index af97eabf0fb..4187f3404e1 100644 --- a/src/parser/parse_tree_cl.c +++ b/src/parser/parse_tree_cl.c @@ -8275,6 +8275,15 @@ pt_print_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p) } break; + case PT_SERIAL_COMMENT: + if (p->info.serial.comment != NULL) + { + r1 = pt_print_bytes (parser, p->info.serial.comment); + q = pt_append_nulstring (parser, q, " comment "); + q = pt_append_varchar (parser, q, r1); + } + break; + default: assert (false); break; diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index d0fc434233e..2f4326e23bf 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -10031,6 +10031,14 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) } break; + case PT_SERIAL_COMMENT: + if (node->info.serial.comment == NULL) + { + PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); + return; + } + break; + default: assert (false); break; diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index 4e808c31abe..c0a30a8f728 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2887,6 +2887,10 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) } break; + case PT_SERIAL_COMMENT: + /* Use only comment */ + break; + default: assert (false); break; From 6108a058d7f2beb9eb22da50ff4222cf8c755c2e Mon Sep 17 00:00:00 2001 From: jongmin-won Date: Wed, 8 May 2024 17:34:32 +0900 Subject: [PATCH 21/21] style: Delete PT_SERIAL_COMMENT --- src/parser/csql_grammar.y | 4 ---- src/parser/parse_tree.h | 5 ++--- src/parser/parse_tree_cl.c | 9 --------- src/parser/semantic_check.c | 8 -------- src/query/execute_statement.c | 4 ---- 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index 577033fd29d..b8f56726778 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -3879,10 +3879,6 @@ alter_stmt { node->info.serial.code = PT_CHANGE_OWNER; } - else if (comment != NULL) - { - node->info.serial.code = PT_SERIAL_COMMENT; - } } DBG_PRINT}} | ALTER /* 1 */ diff --git a/src/parser/parse_tree.h b/src/parser/parse_tree.h index 935707e0e99..04b7b61ebd2 100644 --- a/src/parser/parse_tree.h +++ b/src/parser/parse_tree.h @@ -1445,8 +1445,7 @@ typedef enum PT_CHANGE_INDEX_STATUS, PT_ADD_MEMBERS, /* alter user type */ PT_DROP_MEMBERS, - PT_SERIAL_OPTION, /* alter serial type */ - PT_SERIAL_COMMENT + PT_SERIAL_OPTION /* alter serial type */ } PT_ALTER_CODE; /* Codes for trigger event type */ @@ -2184,7 +2183,7 @@ struct pt_serial_info PT_NODE *cached_num_val; /* PT_VALUE */ PT_NODE *owner_name; /* PT_NAME */ PT_NODE *comment; /* PT_VALUE */ - PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER, PT_SERIAL_COMMENT */ + PT_ALTER_CODE code; /* PT_SERIAL_OPTION, PT_CHANGE_OWNER */ int cyclic; int no_max; int no_min; diff --git a/src/parser/parse_tree_cl.c b/src/parser/parse_tree_cl.c index 4187f3404e1..af97eabf0fb 100644 --- a/src/parser/parse_tree_cl.c +++ b/src/parser/parse_tree_cl.c @@ -8275,15 +8275,6 @@ pt_print_alter_serial (PARSER_CONTEXT * parser, PT_NODE * p) } break; - case PT_SERIAL_COMMENT: - if (p->info.serial.comment != NULL) - { - r1 = pt_print_bytes (parser, p->info.serial.comment); - q = pt_append_nulstring (parser, q, " comment "); - q = pt_append_varchar (parser, q, r1); - } - break; - default: assert (false); break; diff --git a/src/parser/semantic_check.c b/src/parser/semantic_check.c index 2f4326e23bf..d0fc434233e 100644 --- a/src/parser/semantic_check.c +++ b/src/parser/semantic_check.c @@ -10031,14 +10031,6 @@ pt_check_alter_serial (PARSER_CONTEXT * parser, PT_NODE * node) } break; - case PT_SERIAL_COMMENT: - if (node->info.serial.comment == NULL) - { - PT_ERRORmf (parser, node, MSGCAT_SET_PARSER_SEMANTIC, MSGCAT_SEMANTIC_SERIAL_ALTER_NO_OPTION, 0); - return; - } - break; - default: assert (false); break; diff --git a/src/query/execute_statement.c b/src/query/execute_statement.c index c0a30a8f728..4e808c31abe 100644 --- a/src/query/execute_statement.c +++ b/src/query/execute_statement.c @@ -2887,10 +2887,6 @@ do_alter_serial (PARSER_CONTEXT * parser, PT_NODE * statement) } break; - case PT_SERIAL_COMMENT: - /* Use only comment */ - break; - default: assert (false); break;