Skip to content

Commit

Permalink
cherry pick pingcap#11706 to release-3.1
Browse files Browse the repository at this point in the history
Signed-off-by: sre-bot <sre-bot@pingcap.com>
  • Loading branch information
amyangfei authored and sre-bot committed Apr 8, 2020
1 parent a153f19 commit dfd0d0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion executor/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ func (e *AnalyzeFastExec) getNextSampleKey(bo *tikv.Backoffer, startKey kv.Key)
if err != nil {
return nil, err
}
if bytes.Compare(loc.StartKey, e.sampTasks[prefixLen].Location.EndKey) == 0 {
if bytes.Equal(loc.StartKey, e.sampTasks[prefixLen].Location.EndKey) {
startKey = loc.StartKey
break
}
Expand Down
4 changes: 4 additions & 0 deletions executor/load_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ func (e *LoadDataInfo) getFieldsFromLine(line []byte) ([]field, error) {
for {
eol, f := reader.GetField()
f = f.escape()
<<<<<<< HEAD
if string(f.str) == "NULL" && !f.enclosed {
=======
if bytes.Equal(f.str, null) && !f.enclosed {
>>>>>>> 3076e63... *: use bytes.Equal to check byte slice equivalent (#11706)
f.str = []byte{'N'}
f.maybeNull = true
}
Expand Down
2 changes: 1 addition & 1 deletion store/tikv/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func (c *RegionCache) loadRegion(bo *Backoffer, key []byte, isEndKey bool) (*Reg
if len(meta.Peers) == 0 {
return nil, errors.New("receive Region with no peer")
}
if isEndKey && !searchPrev && bytes.Compare(meta.StartKey, key) == 0 && len(meta.StartKey) != 0 {
if isEndKey && !searchPrev && bytes.Equal(meta.StartKey, key) && len(meta.StartKey) != 0 {
searchPrev = true
continue
}
Expand Down

0 comments on commit dfd0d0a

Please sign in to comment.