---------------------------------------------------------------- * isJoinExprNull * * Checks if the join expression evaluates to NULL for a given * input tuple. * * The input tuple has to be present in the correct TupleTableSlot * in the ExprContext. For example, if all the expressions * in joinExpr refer to the inner side of the join, * econtext->ecxt_innertuple must be valid. * -------
| 4320 | * ---------------------------------------------------------------- |
| 4321 | */ |
| 4322 | bool |
| 4323 | isJoinExprNull(List *joinExpr, ExprContext *econtext) |
| 4324 | { |
| 4325 | ListCell *lc; |
| 4326 | bool joinkeys_null = true; |
| 4327 | |
| 4328 | Assert(joinExpr != NIL); |
| 4329 | |
| 4330 | foreach(lc, joinExpr) |
| 4331 | { |
| 4332 | ExprState *keyexpr = (ExprState *) lfirst(lc); |
| 4333 | bool isNull = false; |
| 4334 | |
| 4335 | /* |
| 4336 | * Evaluate the current join attribute value of the tuple |
| 4337 | */ |
| 4338 | ExecEvalExpr(keyexpr, econtext, &isNull); |
| 4339 | |
| 4340 | if (!isNull) |
| 4341 | { |
| 4342 | /* Found at least one non-null join expression, we're done */ |
| 4343 | joinkeys_null = false; |
| 4344 | break; |
| 4345 | } |
| 4346 | } |
| 4347 | |
| 4348 | return joinkeys_null; |
| 4349 | } |
| 4350 | |
| 4351 | |
| 4352 |
no test coverage detected