| 775 | }; |
| 776 | |
| 777 | void AggregateFunctions::CovarInit(FunctionContext* ctx, StringVal* dst) { |
| 778 | dst->is_null = false; |
| 779 | dst->len = sizeof(CovarState); |
| 780 | AllocBuffer(ctx, dst, dst->len); |
| 781 | if (UNLIKELY(dst->is_null)) { |
| 782 | DCHECK(!ctx->impl()->state()->GetQueryStatus().ok()); |
| 783 | return; |
| 784 | } |
| 785 | *(reinterpret_cast<CovarState*>(dst->ptr)) = {}; |
| 786 | } |
| 787 | |
| 788 | static inline void CovarUpdateState(double x, double y, CovarState* state) { |
| 789 | ++state->count; |
nothing calls this directly
no test coverage detected