---------------------------------------------------------------- * extractFuncExprArgs * * Extract the arguments of a FuncExpr or an OpExpr and append them into two * given lists: * - lclauses for the left side of the expression, * - rclauses for the right side * * This function is only used for LASJ. Once we find a NULL from inner side, we * can skip the join and just return an empty
| 737 | * ---------------------------------------------------------------- |
| 738 | */ |
| 739 | static void |
| 740 | extractFuncExprArgs(Expr *clause, List **lclauses, List **rclauses) |
| 741 | { |
| 742 | if (IsA(clause, OpExpr)) |
| 743 | { |
| 744 | OpExpr *opexpr = (OpExpr *) clause; |
| 745 | |
| 746 | if (list_length(opexpr->args) != 2) |
| 747 | return; |
| 748 | |
| 749 | if (!op_strict(opexpr->opno)) |
| 750 | return; |
| 751 | |
| 752 | *lclauses = lappend(*lclauses, linitial(opexpr->args)); |
| 753 | *rclauses = lappend(*rclauses, lsecond(opexpr->args)); |
| 754 | } |
| 755 | else if (IsA(clause, FuncExpr)) |
| 756 | { |
| 757 | FuncExpr *fexpr = (FuncExpr *) clause; |
| 758 | |
| 759 | if (list_length(fexpr->args) != 2) |
| 760 | return; |
| 761 | |
| 762 | if (!func_strict(fexpr->funcid)) |
| 763 | return; |
| 764 | |
| 765 | *lclauses = lappend(*lclauses, linitial(fexpr->args)); |
| 766 | *rclauses = lappend(*rclauses, lsecond(fexpr->args)); |
| 767 | } |
| 768 | else |
| 769 | elog(ERROR, "unexpected join qual in JOIN_LASJ_NOTIN join"); |
| 770 | } |
no test coverage detected