Skip to content

Commit

Permalink
fix time_func
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhuang2016 committed Aug 28, 2019
1 parent 9b7c3f6 commit 6b60704
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package types
import (
"bytes"
"fmt"
"io"
"math"
"regexp"
"strconv"
Expand Down Expand Up @@ -1077,6 +1078,9 @@ func ParseDuration(sc *stmtctx.StatementContext, str string, fsp int) (Duration,
return ZeroDuration, ErrTruncatedWrongVal.GenWithStackByArgs("time", origStr)
}

if terror.ErrorEqual(err, io.EOF) {
err = ErrTruncatedWrongVal.GenWithStackByArgs("time", origStr)
}
if err != nil {
return ZeroDuration, errors.Trace(err)
}
Expand Down

0 comments on commit 6b60704

Please sign in to comment.