Skip to content

Commit

Permalink
fix gogenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Mar 8, 2022
1 parent c6afd1a commit 313f055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion expression/builtin_time_vec_generated.go

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

14 changes: 2 additions & 12 deletions expression/generator/time_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,7 @@ func (b *{{.SigName}}) vecEval{{ .Output.TypeName }}(input *chunk.Chunk, result
{{ else }}
sc := b.ctx.GetSessionVars().StmtCtx
arg1Duration := types.Duration{Duration: arg1, Fsp: -1}
arg1time, err := arg1Duration.ConvertToTime(sc, mysql.TypeDatetime)
if err != nil {
return err
}
tmpDuration := arg0.Sub(sc, &arg1time)
output, err := tmpDuration.ConvertToTime(sc, arg0.Type())
output, err := arg0.Add(sc, arg1Duration.Neg())
{{ end }}
if err != nil {
return err
Expand All @@ -205,12 +200,7 @@ func (b *{{.SigName}}) vecEval{{ .Output.TypeName }}(input *chunk.Chunk, result
}
return err
}
arg1time, err := arg1Duration.ConvertToTime(sc, mysql.TypeDatetime)
if err != nil {
return err
}
tmpDuration := arg0.Sub(sc, &arg1time)
output, err := tmpDuration.ConvertToTime(sc, mysql.TypeDatetime)
output, err := arg0.Add(sc, arg1Duration.Neg())
{{ end }}
if err != nil {
return err
Expand Down

0 comments on commit 313f055

Please sign in to comment.