---------------------------------------------------------------- * ExecInitBitmapOr * * Begin all of the subscans of the BitmapOr node. * ---------------------------------------------------------------- */
| 54 | * ---------------------------------------------------------------- |
| 55 | */ |
| 56 | BitmapOrState * |
| 57 | ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags) |
| 58 | { |
| 59 | BitmapOrState *bitmaporstate = makeNode(BitmapOrState); |
| 60 | PlanState **bitmapplanstates; |
| 61 | int nplans; |
| 62 | int i; |
| 63 | ListCell *l; |
| 64 | Plan *initNode; |
| 65 | |
| 66 | /* check for unsupported flags */ |
| 67 | Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK))); |
| 68 | |
| 69 | /* |
| 70 | * Set up empty vector of subplan states |
| 71 | */ |
| 72 | nplans = list_length(node->bitmapplans); |
| 73 | |
| 74 | bitmapplanstates = (PlanState **) palloc0(nplans * sizeof(PlanState *)); |
| 75 | |
| 76 | /* |
| 77 | * create new BitmapOrState for our BitmapOr node |
| 78 | */ |
| 79 | bitmaporstate->ps.plan = (Plan *) node; |
| 80 | bitmaporstate->ps.state = estate; |
| 81 | bitmaporstate->ps.ExecProcNode = ExecBitmapOr; |
| 82 | bitmaporstate->bitmapplans = bitmapplanstates; |
| 83 | bitmaporstate->nplans = nplans; |
| 84 | |
| 85 | /* |
| 86 | * call ExecInitNode on each of the plans to be executed and save the |
| 87 | * results into the array "bitmapplanstates". |
| 88 | */ |
| 89 | i = 0; |
| 90 | foreach(l, node->bitmapplans) |
| 91 | { |
| 92 | initNode = (Plan *) lfirst(l); |
| 93 | bitmapplanstates[i] = ExecInitNode(initNode, estate, eflags); |
| 94 | i++; |
| 95 | } |
| 96 | |
| 97 | /* |
| 98 | * Miscellaneous initialization |
| 99 | * |
| 100 | * BitmapOr plans don't have expression contexts because they never call |
| 101 | * ExecQual or ExecProject. They don't need any tuple slots either. |
| 102 | */ |
| 103 | |
| 104 | return bitmaporstate; |
| 105 | } |
| 106 | |
| 107 | /* ---------------------------------------------------------------- |
| 108 | * MultiExecBitmapOr |
no test coverage detected