-
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-25749] Add [NOT DETERMINISTIC | DETERMINISTIC] Keywords to the CREATE FUNCTION Statement #5725
base: develop
Are you sure you want to change the base?
[CBRD-25749] Add [NOT DETERMINISTIC | DETERMINISTIC] Keywords to the CREATE FUNCTION Statement #5725
Changes from 1 commit
2260c0b
0542c3f
cd4e6c3
71ee4cc
0fcb37d
ca10800
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ | |
#include "jsp_cl.h" | ||
#include "subquery_cache.h" | ||
#include "pl_signature.hpp" | ||
#include "sp_catalog.hpp" | ||
|
||
#if defined(WINDOWS) | ||
#include "wintcp.h" | ||
|
@@ -27624,6 +27625,18 @@ pt_make_sq_cache_key_struct (QPROC_DB_VALUE_LIST key_struct, void *p, int type) | |
break; | ||
case TYPE_SP: | ||
regu_var_list_p = regu_src->value.sp_ptr->args; | ||
|
||
/* The value of regu_src->value.sp_ptr.sig.dtrm is interpreted as follows | ||
* 0: PT_AUTHID_OWNER + PT_NOT_DETERMINISTIC | ||
* 1: PT_AUTHID_CALLER + PT_NOT_DETERMINISTIC | ||
* 2: PT_AUTHID_OWNER + PT_DETERMINISTIC | ||
* 3: PT_AUTHID_CALLER + PT_DETERMINISTIC | ||
*/ | ||
if (!(regu_src->value.sp_ptr->sig->dtrm & SP_DIRECTIVE_ENUM::SP_DIRECTIVE_RIGHTS_DETERMINISTIC)) | ||
{ | ||
return ER_FAILED; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 불필요한 assign 문이 실행되지 않도록 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. [질문] 이 리턴문이 deterministic 하지 않은 function 은 query cache 를 사용하지 못하도록 제약하는 효과가 있는 것인가요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네, 맞습니다. deterministic 키워드를 사용한 function만 아래 로직을 수행하여 query cache 사용할 수 있습니다. |
||
} | ||
|
||
while (regu_var_list_p) | ||
{ | ||
regu_src = ®u_var_list_p->value; | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -130,6 +130,7 @@ enum sp_directive : int | |||||
{ | ||||||
SP_DIRECTIVE_RIGHTS_OWNER = 0x00, | ||||||
SP_DIRECTIVE_RIGHTS_CALLER = (0x01 << 0), | ||||||
SP_DIRECTIVE_RIGHTS_DETERMINISTIC = (0x02 << 0), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. RIGHTS가 제거되지 않았습니다. RIGHTS는 Execution Rights 관련 문법 (DEFINER, CURRENT_USER) 에 대한 용어입니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 확인 감사합니다. 다시 수정하여 반영 했습니다. |
||||||
}; | ||||||
typedef sp_directive SP_DIRECTIVE_ENUM; | ||||||
|
||||||
|
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.
deterministic 이 authid 앞에 와도 괜찮도록 문법 구성을 해야 할 것 같습니다.
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.
코드 리뷰 감사합니다.
말씀해 주신 부분은 조금 더 코드 분석을 진행한 후 반영하도록 하겠습니다.