Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed May 8, 2019
1 parent 287ce88 commit 11198e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions expression/builtin_cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ func (b *builtinCastTimeAsTimeSig) evalTime(row chunk.Row) (res types.Time, isNu

sc := b.ctx.GetSessionVars().StmtCtx
if res, err = res.Convert(sc, b.tp.Tp); err != nil {
return res, true, err
return types.Time{}, true, handleInvalidTimeError(b.ctx, err)
}
res, err = res.RoundFrac(sc, b.tp.Decimal)
if b.tp.Tp == mysql.TypeDate {
Expand Down Expand Up @@ -1514,7 +1514,7 @@ func (b *builtinCastDurationAsTimeSig) evalTime(row chunk.Row) (res types.Time,
sc := b.ctx.GetSessionVars().StmtCtx
res, err = val.ConvertToTime(sc, b.tp.Tp)
if err != nil {
return res, false, err
return types.Time{}, true, handleInvalidTimeError(b.ctx, err)
}
res, err = res.RoundFrac(sc, b.tp.Decimal)
return res, false, err
Expand Down Expand Up @@ -1638,7 +1638,7 @@ func (b *builtinCastJSONAsTimeSig) evalTime(row chunk.Row) (res types.Time, isNu
sc := b.ctx.GetSessionVars().StmtCtx
res, err = types.ParseTime(sc, s, b.tp.Tp, b.tp.Decimal)
if err != nil {
return res, false, err
return types.Time{}, true, handleInvalidTimeError(b.ctx, err)
}
if b.tp.Tp == mysql.TypeDate {
// Truncate hh:mm:ss part if the type is Date.
Expand Down

0 comments on commit 11198e0

Please sign in to comment.