Skip to content

Commit 031c2c5

Browse files
ari-eAri Ekmekji
authored andcommitted
Get test to pass
1 parent 60a99f1 commit 031c2c5

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

pkg/planner/core/casetest/index/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ go_test(
99
],
1010
data = glob(["testdata/**"]),
1111
flaky = True,
12-
shard_count = 5,
12+
shard_count = 6,
1313
deps = [
1414
"//pkg/testkit",
1515
"//pkg/testkit/testdata",

pkg/util/ranger/detacher.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,14 @@ func getPotentialEqOrInColOffset(sctx *rangerctx.RangerContext, expr expression.
183183
}
184184
}
185185
case ast.IsNull:
186-
if _, ok := f.GetArgs()[0].(*expression.Column); ok {
187-
return 0
186+
c, ok := f.GetArgs()[0].(*expression.Column)
187+
if !ok {
188+
return -1
189+
}
190+
for i, col := range cols {
191+
if col.EqualColumn(c) {
192+
return i
193+
}
188194
}
189195
}
190196
return -1

pkg/util/ranger/ranger_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,7 +2228,7 @@ create table t(
22282228
indexPos: 0,
22292229
exprStr: "a is null",
22302230
accessConds: "[isnull(test.t.a)]",
2231-
filterConds: "[]",
2231+
filterConds: "[isnull(test.t.a)]",
22322232
resultStr: "[[NULL,NULL]]",
22332233
},
22342234
{
@@ -2242,7 +2242,7 @@ create table t(
22422242
indexPos: 1,
22432243
exprStr: "a = 'a' and b is null",
22442244
accessConds: "[eq(test.t.a, a) isnull(test.t.b)]",
2245-
filterConds: "[eq(test.t.a, a)]",
2245+
filterConds: "[eq(test.t.a, a) isnull(test.t.b)]",
22462246
resultStr: "[[\"a\" NULL,\"a\" NULL]]",
22472247
},
22482248
{
@@ -2256,7 +2256,7 @@ create table t(
22562256
indexPos: 2,
22572257
exprStr: "c is null",
22582258
accessConds: "[isnull(test.t.c)]",
2259-
filterConds: "[]",
2259+
filterConds: "[isnull(test.t.c)]",
22602260
resultStr: "[[NULL,NULL]]",
22612261
},
22622262
{
@@ -2270,7 +2270,7 @@ create table t(
22702270
indexPos: 3,
22712271
exprStr: "d is null",
22722272
accessConds: "[isnull(test.t.d)]",
2273-
filterConds: "[]",
2273+
filterConds: "[isnull(test.t.d)]",
22742274
resultStr: "[[NULL,NULL]]",
22752275
},
22762276
{

0 commit comments

Comments
 (0)