23 #include "utils/fmgrprotos.h"
167 scanstate->
begun =
false;
243 (
errcode(ERRCODE_INVALID_TABLESAMPLE_ARGUMENT),
244 errmsg(
"TABLESAMPLE parameter cannot be null")));
255 (
errcode(ERRCODE_INVALID_TABLESAMPLE_REPEAT),
256 errmsg(
"TABLESAMPLE REPEATABLE parameter cannot be null")));
275 seed = scanstate->
seed;
313 scanstate->
begun =
true;
337 scanstate->
done =
true;
#define Assert(condition)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
List * ExecInitExprList(List *nodes, PlanState *parent)
ExprState * ExecInitQual(List *qual, PlanState *parent)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
TupleTableSlot * ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd)
void ExecAssignScanProjectionInfo(ScanState *node)
void ExecScanReScan(ScanState *node)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTypeTL(PlanState *planstate)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
Relation ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
TupleTableSlot *(* ExecScanAccessMtd)(ScanState *node)
bool(* ExecScanRecheckMtd)(ScanState *node, TupleTableSlot *slot)
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
#define DirectFunctionCall1(func, arg1)
Datum hashfloat8(PG_FUNCTION_ARGS)
void pfree(void *pointer)
static void tablesample_init(SampleScanState *scanstate)
SampleScanState * ExecInitSampleScan(SampleScan *node, EState *estate, int eflags)
void ExecReScanSampleScan(SampleScanState *node)
void ExecEndSampleScan(SampleScanState *node)
static TupleTableSlot * ExecSampleScan(PlanState *pstate)
static TupleTableSlot * SampleNext(SampleScanState *node)
static bool SampleRecheck(SampleScanState *node, TupleTableSlot *slot)
static TupleTableSlot * tablesample_getnext(SampleScanState *scanstate)
#define castNode(_type_, nodeptr)
static int list_length(const List *l)
uint32 pg_prng_uint32(pg_prng_state *state)
pg_prng_state pg_global_prng_state
static uint32 DatumGetUInt32(Datum X)
#define RelationGetDescr(relation)
ExprContext * ps_ExprContext
ExecProcNodeMtd ExecProcNode
struct TsmRoutine * tsmroutine
struct TableSampleClause * tablesample
Relation ss_currentRelation
TupleTableSlot * ss_ScanTupleSlot
struct TableScanDescData * ss_currentScanDesc
EndSampleScan_function EndSampleScan
BeginSampleScan_function BeginSampleScan
NextSampleBlock_function NextSampleBlock
InitSampleScan_function InitSampleScan
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
static void table_endscan(TableScanDesc scan)
static TableScanDesc table_beginscan_sampling(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static void table_rescan_set_params(TableScanDesc scan, struct ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
static bool table_scan_sample_next_block(TableScanDesc scan, struct SampleScanState *scanstate)
static bool table_scan_sample_next_tuple(TableScanDesc scan, struct SampleScanState *scanstate, TupleTableSlot *slot)
TsmRoutine * GetTsmRoutine(Oid tsmhandler)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)