Skip to content

Commit

Permalink
[CBRD-25179] A core dump occurs when the CTE query is a false query (…
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondykk9 authored Jan 29, 2024
1 parent 2e46ca3 commit 9cffae9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/parser/xasl_generation.c
Original file line number Diff line number Diff line change
Expand Up @@ -13567,9 +13567,20 @@ pt_uncorr_post (PARSER_CONTEXT * parser, PT_NODE * node, void *arg, int *continu
PT_NODE *non_recursive_part = node->info.cte.non_recursive_part;
// non_recursive_part can become PT_VALUE during constant folding
assert (PT_IS_QUERY (non_recursive_part) || PT_IS_VALUE_NODE (non_recursive_part));

/*
We need to check a false-query and a select-null query by constant folding.
A false-query and a select-null query are distinguished as follows.
false-query's node_type is PT_VALUE and type_enum is PT_TYPE_NULL.
In select-null query, node_type is PT_SELECT and type_enum is PT_TYPE_NULL.
false-query is not necessary to append xasl because it's not a query.
*/
if (PT_IS_VALUE_NODE (non_recursive_part))
{
info->xasl = pt_append_xasl (xasl, info->xasl);
if (non_recursive_part->type_enum != PT_TYPE_NULL)
{
info->xasl = pt_append_xasl (xasl, info->xasl);
}
break;
}

Expand Down

0 comments on commit 9cffae9

Please sign in to comment.