passes a record to the parent op. if the subquery is non-returning, yield input record(s) otherwise, yields a record produced by the subquery
| 151 | // if the subquery is non-returning, yield input record(s) |
| 152 | // otherwise, yields a record produced by the subquery |
| 153 | static Record _handoff_eager |
| 154 | ( |
| 155 | OpCallSubquery *op // CallSubquery operation |
| 156 | ) { |
| 157 | ASSERT(op->is_returning || op->records != NULL); |
| 158 | |
| 159 | if(!op->is_returning) { |
| 160 | // if there is a record to return from the input records, return it |
| 161 | // NOTICE: The order of records reverses here. |
| 162 | return array_len(op->records) > 0 ? array_pop(op->records) : NULL; |
| 163 | } |
| 164 | |
| 165 | // returning subquery |
| 166 | return OpBase_Consume(op->body); |
| 167 | } |
| 168 | |
| 169 | // eagerly consume and aggregate all the records from the lhs (if exists). pass |
| 170 | // the aggregated record-list to the ArgumentList operation(s) |
no test coverage detected