Skip to content

Commit

Permalink
convert to upper case while storing and checking on map. Add unit tes…
Browse files Browse the repository at this point in the history
…ts for sql_mode behaviour in set primitive

Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Oct 19, 2021
1 parent 23d7c4f commit 30408de
Show file tree
Hide file tree
Showing 2 changed files with 280 additions and 204 deletions.
3 changes: 2 additions & 1 deletion go/vt/vtgate/engine/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,15 @@ func sqlModeChangedValue(qr *sqltypes.Result) (bool, string) {
origMap := map[string]bool{}
for _, oVal := range origArr {
// Default is not seen.
origMap[oVal] = true
origMap[strings.ToUpper(oVal)] = true
}
uniqOrigVal := len(origMap)
origValSeen := 0

changed := false
newValArr := strings.Split(newVal, ",")
for _, nVal := range newValArr {
nVal = strings.ToUpper(nVal)
notSeen, exists := origMap[nVal]
if !exists {
changed = true
Expand Down
Loading

0 comments on commit 30408de

Please sign in to comment.