executor: add conversion to opaque value for json_objectagg and json_arrayagg (#37337)

close pingcap/tidb#25053
This commit is contained in:
YangKeao
2022-08-25 05:20:22 -04:00
committed by GitHub
parent b4b52234cc
commit 4c8c918c43
4 changed files with 104 additions and 39 deletions

View File

@ -85,9 +85,10 @@ func (e *jsonArrayagg) UpdatePartialResult(sctx sessionctx.Context, rowsInGroup
return 0, errors.Trace(err)
}
realItem := item.Clone().GetValue()
realItem := getRealJSONValue(item, e.args[0].GetType())
switch x := realItem.(type) {
case nil, bool, int64, uint64, float64, string, json.BinaryJSON, *types.MyDecimal, []uint8, types.Time, types.Duration:
case nil, bool, int64, uint64, float64, string, json.BinaryJSON, json.Opaque, *types.MyDecimal, []uint8, types.Time, types.Duration:
p.entries = append(p.entries, realItem)
memDelta += getValMemDelta(realItem)
default: