Skip to content

Commit

Permalink
util/ranger: fix explain does not display range[NULL, NULL] (pingcap#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelice authored Aug 11, 2020
1 parent 15a7db7 commit 3b35c89
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion planner/core/testdata/analyze_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
],
[
"IndexLookUp_7 2.00 root ",
"├─IndexFullScan_5(Build) 2.00 cop[tikv] table:t, index:idx(a) keep order:false",
"├─IndexRangeScan_5(Build) 2.00 cop[tikv] table:t, index:idx(a) range:[NULL,NULL], keep order:false",
"└─TableRowIDScan_6(Probe) 2.00 cop[tikv] table:t keep order:false"
],
[
Expand Down
4 changes: 2 additions & 2 deletions statistics/testdata/stats_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Name": "TestColumnIndexNullEstimation",
"Cases": [
[
"IndexReader_6 4.00 root index:IndexFullScan_5",
"└─IndexFullScan_5 4.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
"IndexReader_6 4.00 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], keep order:false"
],
[
"IndexReader_6 1.00 root index:IndexFullScan_5",
Expand Down
3 changes: 2 additions & 1 deletion util/ranger/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (ran *Range) IsFullRange() bool {
lowValRawString := formatDatum(ran.LowVal[i], true)
highValRawString := formatDatum(ran.HighVal[i], false)
if ("-inf" != lowValRawString && "NULL" != lowValRawString) ||
("+inf" != highValRawString && "NULL" != highValRawString) {
("+inf" != highValRawString && "NULL" != highValRawString) ||
("NULL" == lowValRawString && "NULL" == highValRawString) {
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion util/ranger/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (s *testRangeSuite) TestIsFullRange(c *C) {
LowVal: []types.Datum{*nullDatum.Clone()},
HighVal: []types.Datum{*nullDatum.Clone()},
},
isFullRange: true,
isFullRange: false,
},
{
ran: ranger.Range{
Expand Down

0 comments on commit 3b35c89

Please sign in to comment.