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

[APIS-936] Handle NULL pointer exception, TextLength2Ptr in SQLNativeSql #64

Merged
merged 1 commit into from
Oct 8, 2022
Merged

[APIS-936] Handle NULL pointer exception, TextLength2Ptr in SQLNativeSql #64

merged 1 commit into from
Oct 8, 2022

Conversation

kisoo-han
Copy link
Contributor

http://jira.cubrid.org/browse/APIS-936

Purpose

  • check value of TextLength2Ptr is NULL before execute following style of statement
    *TextLength2Ptr = length;
  • revise ODBC CPP test cases

Implementation
N/A

Remarks

@kisoo-han kisoo-han self-assigned this Oct 7, 2022
@kisoo-han kisoo-han requested a review from airnet73 October 7, 2022 07:02
@kisoo-han kisoo-han changed the title [APIS-936] Handle TextLength2Ptr NULL exception in SQLNativeSql [APIS-936] Handle NULL pointer exception, for TextLength2Ptr, in SQLNativeSql Oct 7, 2022
@kisoo-han kisoo-han changed the title [APIS-936] Handle NULL pointer exception, for TextLength2Ptr, in SQLNativeSql [APIS-936] Handle NULL pointer exception, TextLength2Ptr in SQLNativeSql Oct 7, 2022
@@ -1389,6 +1389,12 @@ SQLNativeSql (SQLHDBC ConnectionHandle,

odbc_free_diag (((ODBC_CONNECTION *) ConnectionHandle)->diag, RESET);

if (TextLength2Ptr == NULL)
{
odbc_set_diag (((ODBC_CONNECTION *) ConnectionHandle)->diag, "HY009", 0, "NULL pointer: TextLength2Ptr");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about ignoring if TextLength2Ptr is NULL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to just ignore it and return it. However, I want to keep the selection this time for the following reasons:

  1. A build of this fix has been sent to a customer and has already been verified, and if we make a change, we need to run this cycle again.
  2. There is no clear definition of this part in the definition of ODBC API. Your opinion may be more reasonable.
  3. A test case has already been written based on the error return.
  4. The choice of response to this error seems trivial.

Anyway, thanks for your comment.

@kisoo-han kisoo-han merged commit bb3c7bb into CUBRID:develop Oct 8, 2022
tw-kang pushed a commit that referenced this pull request Aug 22, 2023
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.

2 participants