-
Notifications
You must be signed in to change notification settings - Fork 123
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-25709] Trigger DEFERRED 구문에서 재귀 구조 발생 시 무한 루프 발생(Maximum trigger depth 미작동) #5676
base: develop
Are you sure you want to change the base?
Conversation
src/object/trigger_manager.c
Outdated
{ | ||
if (its_deleted (t->target)) | ||
++tr_curr_step; | ||
if (compare_recursion_levels (tr_curr_step, tr_Maximum_depth) > 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.
tr_Maximum_depth 변수는 실제 depth를 의미하는 것인데, tr_curr_step은 dept가 아니라 대상이 되는 숫자라서 비교가 적절하지 않은 것 같습니다.
가령 어떤 update 트리거가 있을 때 update된 레코드가 1000개라면 저 값은 1000이 될 수 있어야 합니다.
create table foo(n int);
insert into foo select rownum from db_class a, db_class b limit 100;
CREATE TRIGGER foo_trigger5 DEFERRED UPDATE ON foo IF obj.n >= 1 EXECUTE PRINT 'foo_trigger 1';
update foo set n = n+1;
위와 같이 하면 tr_curr_step는 100 된다는...
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.
피드백 감사드립니다.
네 말씀해 주신 부분이 맞습니다.
그 부분까지 고려해서 다시 요청드리겠습니다.
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.
말씀해 주신 부분을 고려하여 수정하였습니다.
요약하자면, while 문을 시작할 때를 기준으로 head 부터 tail 까지를 한 step 으로 묶어서, depth 와 동일하게 32 step(묶음)을 넘어가면 에러를 발생시키는 방법으로 구현했습니다.
더 자세한 내용은 회의 때 말씀드리도록 하겠습니다.
2e553a8
to
03a16cf
Compare
Applied a Breadth-First Search(BFS) structure to deferred triggers, distinguishing them from before and after triggers, which follow a Depth-First Search(DFS) structure.
http://jira.cubrid.org/browse/CBRD-25709
Purpose
Implementation