* Like makeNumericAggState(), but allocate the state in the current memory * context. */
| 4649 | * context. |
| 4650 | */ |
| 4651 | static NumericAggState * |
| 4652 | makeNumericAggStateCurrentContext(bool calcSumX2) |
| 4653 | { |
| 4654 | NumericAggState *state; |
| 4655 | |
| 4656 | state = (NumericAggState *) palloc0(sizeof(NumericAggState)); |
| 4657 | state->calcSumX2 = calcSumX2; |
| 4658 | state->agg_context = CurrentMemoryContext; |
| 4659 | |
| 4660 | return state; |
| 4661 | } |
| 4662 | |
| 4663 | /* |
| 4664 | * Accumulate a new input value for numeric aggregate functions. |
no test coverage detected