Skip to content

Commit

Permalink
[CBRD-24705] When attempting a covered index scan in a connect by que…
Browse files Browse the repository at this point in the history
…ry, encountering 'Execute: Query execution failure' (#4237)

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

The issue is caused by not initializing the previously used `(INDX_SCAN_ID *)->indx_cov` when scanning with the next `QFILE_LIST_ID (listfile1)` in the qexec_execute_connect_by function. To resolve the issue, add code to initialize `(INDX_SCAN_ID*)->indx_cov` after scanning `QFILE_LIST_ID (listfile1)`.
  • Loading branch information
youngjinj authored Mar 31, 2023
1 parent 5893f2d commit b79227d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/query/query_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -15621,6 +15621,22 @@ qexec_execute_connect_by (THREAD_ENTRY * thread_p, XASL_NODE * xasl, XASL_STATE

qfile_close_scan (thread_p, &lfscan_id);

if (xasl->spec_list->s_id.type == S_INDX_SCAN && SCAN_IS_INDEX_COVERED (&xasl->spec_list->s_id.s.isid))
{
INDX_SCAN_ID *isidp = &xasl->spec_list->s_id.s.isid;

/* close current list and start a new one */
qfile_close_scan (thread_p, isidp->indx_cov.lsid);
qfile_destroy_list (thread_p, isidp->indx_cov.list_id);
isidp->indx_cov.list_id =
qfile_open_list (thread_p, isidp->indx_cov.type_list, NULL, isidp->indx_cov.query_id, 0,
isidp->indx_cov.list_id);
if (isidp->indx_cov.list_id == NULL)
{
GOTO_EXIT_ON_ERROR;
}
}

if (qp_lfscan != S_END)
{
GOTO_EXIT_ON_ERROR;
Expand Down

0 comments on commit b79227d

Please sign in to comment.