Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FNullRejecting() error while trying to process zero-placed predic…
…ate. When trying to do NULL rejection over zero-placed predicate, e.g. any strict function with zero arguments, we may pass NULL children array from EberEvaluate() to underlying Eber() functions. This may lead to errors, such as assertion error at EberNullOnAnyNullChild() function which used by many subclasses. As underlying Eber() functions doesn't perform any NULL check, we need to pass an empty array to them in case we working with zero-placed predicate. Another option was to return EberAny from EberEvaluate() in case we dealing with zero arity, but there is underlying CScalarConst::Eber() function which should be called and which do it's stuff ignoring incoming argument at all. Here I decided to keep current solution as it's clean. A little highlighting of function folding. If you'll remove topmost select from any of new tests, you'll not get an error because strict function will be folded, and thus, became Const. Starting from 4cf4743 such functions under topmost select not folded, because such select has no parse->rtable. At the other hand, Postgres planner, on which ORCA fell back before current patch, can do folding because of separate calls to eval_const_expressions() from subplans.
- Loading branch information