---------------------------------------------------------------- * ExecInitBitmapAnd * * Begin all of the subscans of the BitmapAnd node. * ---------------------------------------------------------------- */
| 54 | * ---------------------------------------------------------------- |
| 55 | */ |
| 56 | BitmapAndState * |
| 57 | ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags) |
| 58 | { |
| 59 | BitmapAndState *bitmapandstate; |
| 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 | bitmapandstate = makeNode(BitmapAndState); |
| 75 | bitmapplanstates = (PlanState **) palloc0(nplans * sizeof(PlanState *)); |
| 76 | |
| 77 | /* |
| 78 | * create new BitmapAndState for our BitmapAnd node |
| 79 | */ |
| 80 | bitmapandstate->ps.plan = (Plan *) node; |
| 81 | bitmapandstate->ps.state = estate; |
| 82 | bitmapandstate->ps.ExecProcNode = ExecBitmapAnd; |
| 83 | bitmapandstate->bitmapplans = bitmapplanstates; |
| 84 | bitmapandstate->nplans = nplans; |
| 85 | |
| 86 | /* |
| 87 | * call ExecInitNode on each of the plans to be executed and save the |
| 88 | * results into the array "bitmapplanstates". |
| 89 | */ |
| 90 | i = 0; |
| 91 | foreach(l, node->bitmapplans) |
| 92 | { |
| 93 | initNode = (Plan *) lfirst(l); |
| 94 | bitmapplanstates[i] = ExecInitNode(initNode, estate, eflags); |
| 95 | i++; |
| 96 | } |
| 97 | |
| 98 | /* |
| 99 | * Miscellaneous initialization |
| 100 | * |
| 101 | * BitmapAnd plans don't have expression contexts because they never call |
| 102 | * ExecQual or ExecProject. They don't need any tuple slots either. |
| 103 | */ |
| 104 | |
| 105 | return bitmapandstate; |
| 106 | } |
| 107 | |
| 108 | /* ---------------------------------------------------------------- |
| 109 | * MultiExecBitmapAnd |
no test coverage detected