Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jul 24, 2024
1 parent 6b81fea commit efccacd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/planner/core/issuetest/planner_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,10 @@ func TestIssue54803(t *testing.T) {
GROUP BY t1db47fc1.col_68
HAVING ISNULL(t1db47fc1.col_68) OR t1db47fc1.col_68 IN (62, 200, 196, 99)
LIMIT 106149535;
`).Check(testkit.Rows())
`).Check(testkit.Rows("Projection_11 8.00 root trim(cast(test.t1db47fc1.col_68, var_string(20)))->Column#7",
"└─Limit_14 8.00 root offset:0, count:106149535",
" └─HashAgg_17 8.00 root group by:test.t1db47fc1.col_68, funcs:firstrow(test.t1db47fc1.col_68)->test.t1db47fc1.col_68",
" └─TableReader_24 10.00 root partition:all data:Selection_23",
" └─Selection_23 10.00 cop[tikv] isnull(test.t1db47fc1.col_68), or(isnull(test.t1db47fc1.col_68), in(test.t1db47fc1.col_68, 62, 200, 196, 99))",
" └─TableFullScan_22 10000.00 cop[tikv] table:t1db47fc1 keep order:false, stats:pseudo"))
}
9 changes: 8 additions & 1 deletion pkg/util/ranger/detacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,16 @@ func ExtractEqAndInCondition(sctx *rangerctx.RangerContext, conditions []express
accesses := make([]expression.Expression, len(cols))
points := make([][]*point, len(cols))
mergedAccesses := make([]expression.Expression, len(cols))
newConditions := make([]expression.Expression, 0, len(conditions))
columnValues := make([]*valueInfo, len(cols))
tmpConditions := make([]expression.Expression, 0, len(conditions))
for _, cond := range conditions {
if !expression.Contains(sctx.ExprCtx.GetEvalCtx(), conditions, cond) {
tmpConditions = append(tmpConditions, cond)
}
}
conditions = tmpConditions
offsets := make([]int, len(conditions))
newConditions := make([]expression.Expression, 0, len(conditions))
for i, cond := range conditions {
offset := getPotentialEqOrInColOffset(sctx, cond, cols)
offsets[i] = offset
Expand Down

0 comments on commit efccacd

Please sign in to comment.