---------------------------------------------------------------- * ExecInitTidRangeScan * * Initializes the tid range scan's state information, creates * scan keys, and opens the scan relation. * * Parameters: * node: TidRangeScan node produced by the planner. * estate: the execution state initialized in InitPlan. * ---------------------------------------------------------------
| 352 | * ---------------------------------------------------------------- |
| 353 | */ |
| 354 | TidRangeScanState * |
| 355 | ExecInitTidRangeScan(TidRangeScan *node, EState *estate, int eflags) |
| 356 | { |
| 357 | TidRangeScanState *tidrangestate; |
| 358 | Relation currentRelation; |
| 359 | |
| 360 | /* |
| 361 | * create state structure |
| 362 | */ |
| 363 | tidrangestate = makeNode(TidRangeScanState); |
| 364 | tidrangestate->ss.ps.plan = (Plan *) node; |
| 365 | tidrangestate->ss.ps.state = estate; |
| 366 | tidrangestate->ss.ps.ExecProcNode = ExecTidRangeScan; |
| 367 | |
| 368 | /* |
| 369 | * Miscellaneous initialization |
| 370 | * |
| 371 | * create expression context for node |
| 372 | */ |
| 373 | ExecAssignExprContext(estate, &tidrangestate->ss.ps); |
| 374 | |
| 375 | /* |
| 376 | * mark scan as not in progress, and TID range as not computed yet |
| 377 | */ |
| 378 | tidrangestate->trss_inScan = false; |
| 379 | |
| 380 | /* |
| 381 | * open the scan relation |
| 382 | */ |
| 383 | currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags); |
| 384 | |
| 385 | tidrangestate->ss.ss_currentRelation = currentRelation; |
| 386 | tidrangestate->ss.ss_currentScanDesc = NULL; /* no table scan here */ |
| 387 | |
| 388 | /* |
| 389 | * get the scan type from the relation descriptor. |
| 390 | */ |
| 391 | ExecInitScanTupleSlot(estate, &tidrangestate->ss, |
| 392 | RelationGetDescr(currentRelation), |
| 393 | table_slot_callbacks(currentRelation)); |
| 394 | |
| 395 | /* |
| 396 | * Initialize result type and projection. |
| 397 | */ |
| 398 | ExecInitResultTypeTL(&tidrangestate->ss.ps); |
| 399 | ExecAssignScanProjectionInfo(&tidrangestate->ss); |
| 400 | |
| 401 | /* |
| 402 | * initialize child expressions |
| 403 | */ |
| 404 | tidrangestate->ss.ps.qual = |
| 405 | ExecInitQual(node->scan.plan.qual, (PlanState *) tidrangestate); |
| 406 | |
| 407 | TidExprListCreate(tidrangestate); |
| 408 | |
| 409 | /* |
| 410 | * all done. |
| 411 | */ |
no test coverage detected