Skip to content

Commit

Permalink
expression: fix a bug in builtinHourSig vec-function (pingcap#13949)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored and sre-bot committed Dec 10, 2019
1 parent 72cd3f2 commit 0255f6a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion expression/builtin_time_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,17 @@ func (b *builtinHourSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) er
}
defer b.bufAllocator.put(buf)
if err = b.args[0].VecEvalDuration(b.ctx, input, buf); err != nil {
return err
result.ResizeInt64(n, false)
i64s := result.Int64s()
for i := 0; i < n; i++ {
res, isNull, err := b.evalInt(input.GetRow(i))
if err != nil {
return err
}
result.SetNull(i, isNull)
i64s[i] = res
}
return nil
}

result.ResizeInt64(n, false)
Expand Down

0 comments on commit 0255f6a

Please sign in to comment.