Skip to content

Commit

Permalink
add fallback for else
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhedu committed Sep 14, 2020
1 parent 15ef76b commit f15c7c0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
22 changes: 16 additions & 6 deletions expression/builtin_compare_vec_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions expression/generator/compare_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,21 @@ func (b *builtin{{ .compare.CompareName }}{{ .type.TypeName }}Sig) vecEval{{ .ty
argLen := len(b.args)
bufs := make([]*chunk.Column, argLen)
sc := b.ctx.GetSessionVars().StmtCtx
beforeWarns := sc.WarningCount()
for i := 0; i < argLen; i++ {
buf, err := b.bufAllocator.get(types.ETInt, n)
if err != nil {
return err
}
defer b.bufAllocator.put(buf)
err = b.args[i].VecEval{{ .type.TypeName }}(b.ctx, input, buf)
if err != nil {
return err
afterWarns := sc.WarningCount()
if err != nil || afterWarns > beforeWarns {
if afterWarns > beforeWarns {
sc.TruncateWarnings(int(beforeWarns))
}
return b.fallbackEval{{ .type.TypeName }}(input, result)
}
bufs[i]=buf
}
Expand Down

0 comments on commit f15c7c0

Please sign in to comment.