Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Jul 27, 2021
1 parent 5c5b987 commit 5a4bf46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions expression/builtin_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ func (c *caseWhenFunctionClass) getFunction(ctx sessionctx.Context, args []Expre
if fieldTp.EvalType().IsStringKind() && !isBinaryStr {
fieldTp.Charset, fieldTp.Collate = DeriveCollationFromExprs(ctx, args...)
if fieldTp.Charset == charset.CharsetBin && fieldTp.Collate == charset.CollationBin {
// When args are Json and Numerical type(eg. Int), the fieldTp is String.
// Both their charset/collation is binary, but the String need a default charset/collation.
fieldTp.Charset, fieldTp.Collate = charset.GetDefaultCharsetAndCollate()
}
} else {
Expand Down

0 comments on commit 5a4bf46

Please sign in to comment.