executor: do not append max int64 handle as pb range.

This commit is contained in:
Ewan Chou
2016-03-25 14:50:05 +08:00
parent af6c1b36c7
commit 3ee6c17389

View File

@ -200,11 +200,12 @@ func (e *XSelectIndexExec) doTableRequest(txn kv.Transaction, handles []int64) (
selTableReq.TableInfo = tablecodec.TableToProto(e.indexPlan.Table)
selTableReq.Fields = resultFieldsToPBExpression(e.indexPlan.Fields())
for _, h := range handles {
if h == math.MaxInt64 {
// We can't convert MaxInt64 into an left closed, right open range.
continue
}
pbRange := new(tipb.KeyRange)
pbRange.Low = codec.EncodeInt(nil, h)
if h != math.MaxInt64 {
h++
}
pbRange.High = codec.EncodeInt(nil, h)
selTableReq.Ranges = append(selTableReq.Ranges, pbRange)
}