-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CBRD-25719] Fix an issue where [user_schema] was incorrectly stored or missing in the condition and action_definition columns of the db_trigger catalog during trigger creation or loaddb execution with legacy unload files #5729
base: develop
Are you sure you want to change the base?
Conversation
…ondition columns of the db_trigger catalog when SP is included when performing create trigger, 2. When creating a trigger with the loaddb --no-user-specified-name utility, find the actual owner and modify it to save it in the db_trigger catalog, 3. When performing the unload utility, remove the owner’s [user_schema] from the action and condition columns.
…s the unload utility.
a1c8fcc
to
195ad20
Compare
…en into an unexecutable rewrite query.
… rewritten into an unexecutable rewrite query.
…rewritten into an unexecutable rewrite query.
… rewritten into an unexecutable rewrite query.
…rewritten into an unexecutable rewrite query.
…rewritten into an unexecutable rewrite query.
…s rewritten into an unexecutable rewrite query.
…ory management issue in the change_trigger_action_query function might be the cause and have made adjustments to address it.
src/parser/compile.c
Outdated
char *p = NULL; | ||
const char *remove_eval_prefix = "evaluate ("; | ||
size_t remove_eval_suffix_len; | ||
|
||
p = strstr (result, remove_eval_prefix); | ||
if (p != NULL) | ||
{ | ||
p = (char *) memmove (p, p + strlen (remove_eval_prefix), strlen (p) - strlen (remove_eval_prefix) + 1); | ||
} | ||
|
||
remove_eval_suffix_len = strlen (p); | ||
if (remove_eval_suffix_len > 0 && p[remove_eval_suffix_len - 1] == ')') | ||
{ | ||
p[remove_eval_suffix_len - 1] = '\0'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #5731 에서 다루는 코드와 동일한 것 같은데 함수로 만들어서 동일하게 유지 하는 것이 좋을 듯 합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
관련 부분은 PR #5731 에서 remove_appended_trigger_evaluate () 함수를 추가 했습니다.
src/parser/compile.c
Outdated
free_and_init (*new_trigger_stmt); | ||
*new_trigger_stmt = strdup (new_trigger_stmt_str); | ||
free_and_init (new_trigger_stmt_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 위쪽에서 단 코멘트 중에 "return result; 로 충분할 듯 합니다." 이러 내용이 있었는데요,
그 코드를 수정하지 않는다면 반대로 이 부분에서 단지 아래와 같은 한 줄만 사용하면 될 것 같습니다.
*new_trigger_stmt = new_trigger_stmt_str;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
말씀하신 부분을 반영하여 수정했습니다.
src/parser/parse_tree_cl.c
Outdated
@@ -11663,6 +11663,12 @@ pt_print_expr (PARSER_CONTEXT * parser, PT_NODE * p) | |||
} | |||
else | |||
{ | |||
if (parser->flag.is_parsing_trigger == 1 && p->info.expr.flag != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (parser->flag.is_parsing_trigger == 1 && p->info.expr.flag != 0) | |
if (parser->flag.is_parsing_trigger && p->info.expr.flag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
말씀하신 부분을 반영하여 수정했습니다.
src/parser/parse_tree_cl.c
Outdated
@@ -13020,7 +13026,7 @@ pt_print_insert (PARSER_CONTEXT * parser, PT_NODE * p) | |||
|
|||
// TODO: [PL/CSQL] need refactoring | |||
unsigned int save_custom = parser->custom_print; | |||
if (parser->flag.is_parsing_static_sql == 1) | |||
if (parser->flag.is_parsing_static_sql == 1 || parser->flag.is_parsing_trigger == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (parser->flag.is_parsing_static_sql == 1 || parser->flag.is_parsing_trigger == 1) | |
if (parser->flag.is_parsing_static_sql || parser->flag.is_parsing_trigger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
말씀하신 부분을 반영하여 수정했습니다.
src/parser/compile.c
Outdated
p = strstr (result, remove_eval_prefix); | ||
if (p != NULL) | ||
{ | ||
p = (char *) memmove (p, p + strlen (remove_eval_prefix), strlen (p) - strlen (remove_eval_prefix) + 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p == NULL 일 때의 처리가 필요해 보입니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
PR #5731에서 remove_appended_trigger_evaluate() 함수를 추가하고, 해당 함수 내부에 반영하여 수정했습니다.
src/parser/compile.c
Outdated
if (with_evaluate) | ||
{ | ||
char *p = NULL; | ||
const char *remove_eval_prefix = "evaluate ("; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"evaluate (", "EVALUATE (", " ) "는
https://github.com/CUBRID/cubrid/pull/5731/files#r1896263225 에서 말씀드린 것과 마찬가지로, 한 곳에서 관리하는 것이 좋을 거 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 감사합니다.
기존 EVALUATE 문자를 소문자로 작성한 이유는, 해당 문자열이 rewritten으로 작성되며 소문자로 변경되었고, evaluate를 제거할 때만 사용되기 때문입니다.
따라서, 해당 문자열은 PR #5731에서 작성한 remove_appended_trigger_evaluate() 함수 내부에서만 사용되도록 수정했습니다.
github-checks / memory-monitor-check (pull_request) 에서 src/parser/compile.c: FAIL 된 이유
예제
해결방안개발 2팀 희수님이 담당으로 알고있어 관련 내용을 전달했습니다. |
다음 PR (CUBRID/cubrid-testcases#2019) 에서 test_sql 과 test_plcsql 의 TC 답안지를 수정 합니다. |
http://jira.cubrid.org/browse/CBRD-25719
Purpose
Implementation
CREATE TRIGGER 동작 순서 수정
Remarks
N/A