Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
  • Loading branch information
windtalker committed Sep 5, 2024
1 parent 6efb5be commit 7a8972f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/executor/join/base_join_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (j *baseJoinProbe) buildResultAfterOtherCondition(chk *chunk.Chunk, joinedC
j.appendBuildRowToCachedBuildRowsV2(&j.rowIndexInfos[index], chk, j.ctx.hashTableMeta.columnCountNeededForOtherCondition, false)
}
}
if len(j.cachedBuildRows) > 0 {
if j.nextCachedBuildRowIndex > 0 {
j.batchConstructBuildRows(chk, j.ctx.hashTableMeta.columnCountNeededForOtherCondition, false)
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/executor/join/outer_join_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (j *outerJoinProbe) ScanRowTable(joinResult *hashjoinWorkerResult, sqlKille
if j.rowIter == nil {
panic("scanRowTable before init")
}
j.cachedBuildRows = j.cachedBuildRows[:0]
j.nextCachedBuildRowIndex = 0
meta := j.ctx.hashTableMeta
insertedRows := 0
remainCap := joinResult.chk.RequiredRows() - joinResult.chk.NumRows()
Expand All @@ -131,7 +131,7 @@ func (j *outerJoinProbe) ScanRowTable(joinResult *hashjoinWorkerResult, sqlKille
joinResult.err = err
return joinResult
}
if len(j.cachedBuildRows) > 0 {
if j.nextCachedBuildRowIndex > 0 {
j.batchConstructBuildRows(joinResult.chk, 0, false)
}
// append probe side in batch
Expand Down Expand Up @@ -176,7 +176,7 @@ func (j *outerJoinProbe) buildResultForMatchedRowsAfterOtherCondition(chk, joine
}
}
if hasRemainCols {
j.cachedBuildRows = j.cachedBuildRows[:0]
j.nextCachedBuildRowIndex = 0
markedJoined = true
meta := j.ctx.hashTableMeta
for index, result := range j.selected {
Expand All @@ -186,7 +186,7 @@ func (j *outerJoinProbe) buildResultForMatchedRowsAfterOtherCondition(chk, joine
j.appendBuildRowToCachedBuildRowsV2(&rowIndexInfo, chk, meta.columnCountNeededForOtherCondition, false)
}
}
if len(j.cachedBuildRows) > 0 {
if j.nextCachedBuildRowIndex > 0 {
j.batchConstructBuildRows(chk, meta.columnCountNeededForOtherCondition, false)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/join/row_table_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func checkColumns(t *testing.T, withSelCol bool, buildFilter expression.CNFExprs
mockJoinProber.appendBuildRowToCachedBuildRowsV1(0, rowStart, resultChunk, 0, hasOtherConditionColumns)
}
}
if len(mockJoinProber.cachedBuildRows) > 0 {
if mockJoinProber.nextCachedBuildRowIndex > 0 {
if hasOtherConditionColumns {
mockJoinProber.batchConstructBuildRows(tmpChunk, 0, hasOtherConditionColumns)
} else {
Expand Down Expand Up @@ -436,7 +436,7 @@ func checkColumns(t *testing.T, withSelCol bool, buildFilter expression.CNFExprs
}
rowIndex++
}
if len(mockJoinProber.cachedBuildRows) > 0 {
if mockJoinProber.nextCachedBuildRowIndex > 0 {
if hasOtherConditionColumns {
mockJoinProber.batchConstructBuildRows(tmpChunk, 0, hasOtherConditionColumns)
} else {
Expand Down

0 comments on commit 7a8972f

Please sign in to comment.