Skip to content

Commit

Permalink
memory: return memory delta from jsonObjectAgg#MergePartialResult (#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
tedyu authored Sep 11, 2023
1 parent c65543a commit e76d10a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions executor/aggfuncs/func_json_objectagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (e *jsonObjectAgg) UpdatePartialResult(sctx sessionctx.Context, rowsInGroup
if err != nil {
return 0, errors.Trace(err)
}
key = strings.Clone(key)

if keyIsNull {
return 0, types.ErrJSONDocumentNULLKey
Expand All @@ -86,6 +85,7 @@ func (e *jsonObjectAgg) UpdatePartialResult(sctx sessionctx.Context, rowsInGroup
return 0, types.ErrInvalidJSONCharset.GenWithStackByArgs(e.args[0].GetType().GetCharset())
}

key = strings.Clone(key)
value, err := e.args[1].Eval(row)
if err != nil {
return 0, errors.Trace(err)
Expand Down Expand Up @@ -203,5 +203,5 @@ func (*jsonObjectAgg) MergePartialResult(_ sessionctx.Context, src, dst PartialR
p2.bInMap++
}
}
return 0, nil
return memDelta, nil
}

0 comments on commit e76d10a

Please sign in to comment.