Skip to content

Commit

Permalink
Update session.go
Browse files Browse the repository at this point in the history
  • Loading branch information
fzzf678 committed Aug 11, 2022
1 parent 023d766 commit f5c57b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1689,13 +1689,13 @@ func (s *SessionVars) GetParseParams() []parser.ParseParam {
}

// SetStringUserVar set the value and collation for user defined variable.
func (s *SessionVars) SetStringUserVar(varName string, svalue string, collation string) {
varName = strings.ToLower(varName)
func (s *SessionVars) SetStringUserVar(name string, strVal string, collation string) {
name = strings.ToLower(name)
if len(collation) > 0 {
s.SetUserVarVal(varName, types.NewCollationStringDatum(stringutil.Copy(svalue), collation))
s.SetUserVarVal(name, types.NewCollationStringDatum(stringutil.Copy(strVal), collation))
} else {
_, collation = s.GetCharsetInfo()
s.SetUserVarVal(varName, types.NewCollationStringDatum(stringutil.Copy(svalue), collation))
s.SetUserVarVal(name, types.NewCollationStringDatum(stringutil.Copy(strVal), collation))
}
}

Expand Down

0 comments on commit f5c57b6

Please sign in to comment.