Maybe something wrong when determine spans overlapping in kvfetcher.go?

version: 2.1.2

pkg/sql/sqlbase/kvfetcher.go:makeKVFetcher()

The code is to determine whether the spans is overlapping.

} else if spans[i].EndKey.Compare(spans[i-1].EndKey) < 0 {

I think this should be

} else if spans[i].EndKey.Compare(spans[i-1].Key) < 0 {

Thanks @xiaolanzao66, we’ll take a look and get back to you on Github.