MCPcopy Create free account
hub / github.com/apache/cloudberry / contains_required_value

Function contains_required_value

contrib/intarray/_int_bool.c:363–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363static bool
364contains_required_value(ITEM *curitem)
365{
366 /* since this function recurses, it could be driven to stack overflow */
367 check_stack_depth();
368
369 if (curitem->type == VAL)
370 return true;
371 else if (curitem->val == (int32) '!')
372 {
373 /*
374 * Assume anything under a NOT is non-required. For some cases with
375 * nested NOTs, we could prove there's a required value, but it seems
376 * unlikely to be worth the trouble.
377 */
378 return false;
379 }
380 else if (curitem->val == (int32) '&')
381 {
382 /* If either side has a required value, we're good */
383 if (contains_required_value(curitem + curitem->left))
384 return true;
385 else
386 return contains_required_value(curitem - 1);
387 }
388 else
389 { /* |-operator */
390 /* Both sides must have required values */
391 if (contains_required_value(curitem + curitem->left))
392 return contains_required_value(curitem - 1);
393 else
394 return false;
395 }
396}
397
398bool
399query_has_required_values(QUERYTYPE *query)

Callers 1

Calls 1

check_stack_depthFunction · 0.85

Tested by

no test coverage detected