Conversation
…d whitespace http://jira.cubrid.org/browse/CBRD-27101 CCI_PREPARE_CALL classified the statement with get_stmt_type(), which compares the head of the raw string, so a valid CALL preceded by a comment or whitespace was rejected with CAS_ER_INVALID_CALL_STMT. Add a non-destructive skip helper to the broker and to cubmethod, and apply it before out-parameter detection, while scanning for '=', and before classification. The '=' scan advances one position at a time and skips only comments, so existing forms such as "?:1 = CALL f()" keep working. The original SQL is preserved, so the execute-time recompile path is unaffected and the destructive ut_trim() call is no longer needed. Base the unprepared fallback decision on the node type the parser produced rather than on the leading keyword, so REPLACE (PT_INSERT) and WITH ... UPDATE are deferred as intended instead of being rejected. Behavior change: UPDATE STATISTICS with a semantic error now fails at prepare instead of at execute. get_stmt_type() matched only the first six characters and reported it as CUBRID_STMT_UPDATE; its grammar accepts only a class list, so no host variable can appear and the deferred recompile could never have succeeded. Also pass the SQL to cubmethod::consume_tokens() by const reference. calculate_num_markers() called it once per comment or quoted token and copied the whole statement each time.
✅ TC Merge Gate — Merge AllowedAll TC PRs are merged, closed, or not present. TC Repositories & Branches:
|
Contributor
Author
|
@greptile 리뷰해주세요. |
🧪 TC Test Environment ReadyCircleCI Testing:
TC Repositories & Branches:
Next Steps:
|
Contributor
|
확인된 동작상 차단 결함은 없어 병합 가능한 상태로 보이지만, 수정된 CALL prepare 문법의 자동화 회귀 테스트를 추가하는 것이 바람직합니다. Reviews (1) · Last reviewed commit: "[CBRD-27101] Fix CALL statement prepare ..." |
Comment on lines
689
to
+718
| @@ -708,7 +714,8 @@ ux_prepare (char *sql_stmt, int flag, char auto_commit_mode, T_NET_BUF * net_buf | |||
| tmp++; | |||
| } | |||
|
|
|||
| ut_trim (tmp); | |||
| /* skip again after removing "? =" before classifying the statement */ | |||
| tmp = skip_leading_whitespace_and_comment (tmp); | |||
Contributor
Contributor
Author
|
/run all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
http://jira.cubrid.org/browse/CBRD-27101
CCI_PREPARE_CALL classified the statement with get_stmt_type(), which compares the head of the raw string, so a valid CALL preceded by a comment or whitespace was rejected with CAS_ER_INVALID_CALL_STMT. Add a non-destructive skip helper to the broker and to cubmethod, and apply it before out-parameter detection, while scanning for '=', and before classification. The '=' scan advances one position at a time and skips only comments, so existing forms such as "?:1 = CALL f()" keep working. The original SQL is preserved, so the execute-time recompile path is unaffected and the destructive ut_trim() call is no longer needed.
Base the unprepared fallback decision on the node type the parser produced rather than on the leading keyword, so REPLACE (PT_INSERT) and WITH ... UPDATE are deferred as intended instead of being rejected.
Behavior change: UPDATE STATISTICS with a semantic error now fails at prepare instead of at execute. get_stmt_type() matched only the first six characters and reported it as CUBRID_STMT_UPDATE; its grammar accepts only a class list, so no host variable can appear and the deferred recompile could never have succeeded.
Also pass the SQL to cubmethod::consume_tokens() by const reference. calculate_num_markers() called it once per comment or quoted token and copied the whole statement each time.