84 elog(
ERROR,
"CTE subplans should not be executed via ExecSubPlan");
86 elog(
ERROR,
"cannot set parent params from subquery");
109 elog(
ERROR,
"hashed subplan with direct correlation not supported");
290 planstate->chgParam =
bms_add_member(planstate->chgParam, paramid);
326 TupleDesc tdesc = slot->tts_tupleDescriptor;
344 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
345 errmsg(
"more than one row returned by a subquery used as an expression")));
383 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
384 errmsg(
"more than one row returned by a subquery used as an expression")));
502 nbuckets = (long)
Min(planstate->plan->plan_rows, (
double) LONG_MAX);
623 int numCols = hashtable->
numCols;
657 for (i = 1; i <= ncols; i++)
677 for (i = 1; i <= ncols; i++)
778 "Subplan HashTable Context",
785 "Subplan HashTable Temp Context",
794 for (i = 0; i < ncols; i++)
825 elog(
ERROR,
"unrecognized testexpr type: %d",
831 lefttlist = righttlist =
NIL;
832 leftptlist = rightptlist =
NIL;
856 expr = exstate->expr;
862 tlestate->xprstate.expr = (
Expr *) tle;
863 tlestate->xprstate.evalfunc =
NULL;
864 tlestate->arg = exstate;
865 lefttlist =
lappend(lefttlist, tlestate);
866 leftptlist =
lappend(leftptlist, tle);
870 expr = exstate->expr;
876 tlestate->xprstate.expr = (
Expr *) tle;
877 tlestate->xprstate.evalfunc =
NULL;
878 tlestate->arg = exstate;
879 righttlist =
lappend(righttlist, tlestate);
880 rightptlist =
lappend(rightptlist, tle);
889 elog(
ERROR,
"could not find compatible hash operator for operator %u",
895 &left_hashfn, &right_hashfn))
896 elog(
ERROR,
"could not find hash function for hash operator %u",
960 elog(
ERROR,
"ANY/ALL subselect unsupported as initplan");
962 elog(
ERROR,
"CTE subplans should not be executed via ExecSetParamPlan");
992 planstate->chgParam =
bms_add_member(planstate->chgParam, paramid);
1003 TupleDesc tdesc = slot->tts_tupleDescriptor;
1039 (
errcode(ERRCODE_CARDINALITY_VIOLATION),
1040 errmsg(
"more than one row returned by a subquery used as an expression")));
1132 elog(
ERROR,
"direct correlated subquery unsupported as initplan");
1134 elog(
ERROR,
"setParam list of initplan is empty");
1136 elog(
ERROR,
"extParam set of initplan is empty");
1153 ParamExecData *prm = &(estate->es_param_exec_vals[paramid]);
bool get_compatible_hash_operators(Oid opno, Oid *lhs_opno, Oid *rhs_opno)
TupleTableSlot * ExecProcNode(PlanState *node)
#define IsA(nodeptr, _type_)
ProjectionInfo * projLeft
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate)
bool get_op_hash_functions(Oid opno, RegProcedure *lhs_procno, RegProcedure *rhs_procno)
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
#define forboth(cell1, list1, cell2, list2)
ExprContext * innerecontext
ArrayBuildStateAny * initArrayResultAny(Oid input_type, MemoryContext rcontext, bool subcontext)
#define TermTupleHashIterator(iter)
static Datum ExecAlternativeSubPlan(AlternativeSubPlanState *node, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
#define PointerGetDatum(X)
Datum(* ExprStateEvalFunc)(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
void ExecReScan(PlanState *node)
TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
Form_pg_attribute * attrs
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
int errcode(int sqlerrcode)
TupleTableSlot * ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone)
void MemoryContextReset(MemoryContext context)
void heap_freetuple(HeapTuple htup)
#define ALLOCSET_DEFAULT_MINSIZE
#define ALLOCSET_SMALL_MINSIZE
SubPlanState * ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
FmgrInfo * tab_hash_funcs
#define ScanTupleHashTable(iter)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
ParamExecData * es_param_exec_vals
void pfree(void *pointer)
struct PlanState * planstate
void ExecReScanSetParamPlan(SubPlanState *node, PlanState *parent)
void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions, long nbuckets, Size entrysize, MemoryContext tablecxt, MemoryContext tempcxt)
bool and_clause(Node *clause)
void * list_nth(const List *list, int n)
ExprStateEvalFunc evalfunc
#define fmgr_info_set_expr(expr, finfo)
ProjectionInfo * ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc)
ParamExecData * ecxt_param_exec_vals
bool execTuplesUnequal(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext)
struct PlanState * parent
MemoryContext CurrentMemoryContext
TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew)
#define ereport(elevel, rest)
TargetEntry * makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk)
static bool slotNoNulls(TupleTableSlot *slot)
static Datum ExecHashSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull)
TupleDesc ExecTypeFromTL(List *targetList, bool hasoid)
Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
List * lappend(List *list, void *datum)
bool bms_is_empty(const Bitmapset *a)
ArrayBuildStateAny * accumArrayResultAny(ArrayBuildStateAny *astate, Datum dvalue, bool disnull, Oid input_type, MemoryContext rcontext)
static bool slotAllNulls(TupleTableSlot *slot)
#define ALLOCSET_SMALL_INITSIZE
HeapTuple ExecCopySlotTuple(TupleTableSlot *slot)
#define heap_getattr(tup, attnum, tupleDesc, isnull)
TupleDesc tts_tupleDescriptor
MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc)
static Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone)
MemoryContext hashtempcxt
RegProcedure get_opcode(Oid opno)
MemoryContext hashtablecxt
bool slot_attisnull(TupleTableSlot *slot, int attnum)
static Datum ExecScanSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull)
AlternativeSubPlanState * ExecInitAlternativeSubPlan(AlternativeSubPlan *asplan, PlanState *parent)
#define Assert(condition)
TupleTableSlot * tableslot
static int list_length(const List *l)
#define InitTupleHashIterator(htable, iter)
Bitmapset * bms_add_member(Bitmapset *a, int x)
MemoryContext ecxt_per_query_memory
FmgrInfo * lhs_hash_funcs
#define DatumGetPointer(X)
static bool findPartialMatch(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions)
Datum makeArrayResultAny(ArrayBuildStateAny *astate, MemoryContext rcontext, bool release)
#define ALLOCSET_SMALL_MAXSIZE
int errmsg(const char *fmt,...)
#define ALLOCSET_DEFAULT_INITSIZE
Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
ExprContext * CreateExprContext(EState *estate)
static void buildSubPlanHash(SubPlanState *node, ExprContext *econtext)
ProjectionInfo * projRight
#define ALLOCSET_DEFAULT_MAXSIZE
ExprContext * pi_exprContext
TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions)
#define ResetExprContext(econtext)