Skip to content

Commit

Permalink
fix flag issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjianke committed Jan 13, 2021
1 parent 2921034 commit 70e7d28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions expression/builtin_arithmetic.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ func (c *arithmeticMinusFunctionClass) getFunction(ctx sessionctx.Context, args
}

forceToSigned := ctx.GetSessionVars().SQLMode.HasNoUnsignedSubtractionMode()
isLHSUnsigned := mysql.HasUnsignedFlag(args[0].GetType().Flag)
isRHSUnsigned := mysql.HasUnsignedFlag(args[1].GetType().Flag)
isLHSUnsigned := !forceToSigned && mysql.HasUnsignedFlag(args[0].GetType().Flag)
isRHSUnsigned := !forceToSigned && mysql.HasUnsignedFlag(args[1].GetType().Flag)

switch {
case forceToSigned && isLHSUnsigned && isRHSUnsigned:
Expand Down

0 comments on commit 70e7d28

Please sign in to comment.