Skip to content
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-24382] Fix segfault when target of CALL statement is not a stored procedure/function #3770

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

hgryoo
Copy link
Member

@hgryoo hgryoo commented Aug 16, 2022

http://jira.cubrid.org/browse/CBRD-24382

Motivation
If CALL stmt is executed with a built-in function, a segmentation fault occurs. Referring to the SQL standard and the CUBRID manual, only a stored procedure can be called in the CALL statement, so an appropriate error should be returned.

Implementation

  • In parsing, If generic_function is not a stored procedure/function, the parsed node type of call_stmt is not PT_METHOD_CALL. I've set an error in the case.
  • For the error message, MSGCAT_SEMANTIC_IS_NOT_A is already defined in the parser message catalog. I've used it.

The error shows as follows.

csql> CALL TO_DATE('12/25/2008');

In line 1, column 15,

ERROR: before ' ; '
 to_date('12/25/2008') is not a procedure.

@hgryoo hgryoo self-assigned this Aug 16, 2022
@hgryoo hgryoo marked this pull request as ready for review August 16, 2022 09:08
@hgryoo hgryoo merged commit b20b268 into CUBRID:develop Aug 23, 2022
hgryoo added a commit to hgryoo/cubrid that referenced this pull request Aug 31, 2022
…ed procedure/function (CUBRID#3770)

http://jira.cubrid.org/browse/CBRD-24382

If CALL stmt is executed with a built-in function, a segmentation fault occurs. Referring to the SQL standard and the CUBRID manual, only a stored procedure can be called in the CALL statement, so an appropriate error should be returned.

- In parsing, If generic_function is not a stored procedure/function, the parsed node type of call_stmt is not PT_METHOD_CALL. I've set an error in the case.
- For the error message, MSGCAT_SEMANTIC_IS_NOT_A is already defined in the parser message catalog.
hgryoo added a commit to hgryoo/cubrid that referenced this pull request Aug 31, 2022
…ed procedure/function (CUBRID#3770)

http://jira.cubrid.org/browse/CBRD-24382

If CALL stmt is executed with a built-in function, a segmentation fault occurs. Referring to the SQL standard and the CUBRID manual, only a stored procedure can be called in the CALL statement, so an appropriate error should be returned.

- In parsing, If generic_function is not a stored procedure/function, the parsed node type of call_stmt is not PT_METHOD_CALL. I've set an error in the case.
- For the error message, MSGCAT_SEMANTIC_IS_NOT_A is already defined in the parser message catalog.
hgryoo added a commit to hgryoo/cubrid that referenced this pull request Aug 31, 2022
…ed procedure/function (CUBRID#3770)

http://jira.cubrid.org/browse/CBRD-24382

If CALL stmt is executed with a built-in function, a segmentation fault occurs. Referring to the SQL standard and the CUBRID manual, only a stored procedure can be called in the CALL statement, so an appropriate error should be returned.

- In parsing, If generic_function is not a stored procedure/function, the parsed node type of call_stmt is not PT_METHOD_CALL. I've set an error in the case.
- For the error message, MSGCAT_SEMANTIC_IS_NOT_A is already defined in the parser message catalog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants