Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#53079
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
windtalker committed May 11, 2024
1 parent f689a82 commit c78fa3b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
22 changes: 22 additions & 0 deletions pkg/executor/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,12 @@ func (fetcher *probeSideTupleFetcher) fetchProbeSideChunks(ctx context.Context,
probeSideResult.Reset()
}
})
<<<<<<< HEAD:pkg/executor/join.go
if probeSideResult.NumRows() == 0 && !fetcher.useOuterToBuild {
fetcher.finished.Store(true)
}
=======
>>>>>>> 5d780ebf8e9 (executor: disable probe short path in hash join (#53079)):pkg/executor/join/join.go
emptyBuild, buildErr := fetcher.wait4BuildSide()
if buildErr != nil {
fetcher.joinResultCh <- &hashjoinWorkerResult{
Expand Down Expand Up @@ -327,13 +330,32 @@ func (w *buildWorker) fetchBuildSideRows(ctx context.Context, chkCh chan<- *chun
return
}
})
<<<<<<< HEAD:pkg/executor/join.go
sessVars := w.hashJoinCtx.sessCtx.GetSessionVars()
=======
sessVars := w.HashJoinCtx.SessCtx.GetSessionVars()
failpoint.Inject("issue51998", func(val failpoint.Value) {
if val.(bool) {
time.Sleep(2 * time.Second)
}
})
>>>>>>> 5d780ebf8e9 (executor: disable probe short path in hash join (#53079)):pkg/executor/join/join.go
for {
if w.hashJoinCtx.finished.Load() {
return
}
<<<<<<< HEAD:pkg/executor/join.go
chk := w.hashJoinCtx.allocPool.Alloc(w.buildSideExec.RetFieldTypes(), sessVars.MaxChunkSize, sessVars.MaxChunkSize)
err = exec.Next(ctx, w.buildSideExec, chk)
=======
chk := w.HashJoinCtx.ChunkAllocPool.Alloc(w.BuildSideExec.RetFieldTypes(), sessVars.MaxChunkSize, sessVars.MaxChunkSize)
err = exec.Next(ctx, w.BuildSideExec, chk)
failpoint.Inject("issue51998", func(val failpoint.Value) {
if val.(bool) {
err = errors.Errorf("issue51998 build return error")
}
})
>>>>>>> 5d780ebf8e9 (executor: disable probe short path in hash join (#53079)):pkg/executor/join/join.go
if err != nil {
errCh <- errors.Trace(err)
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/test/issuetest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go_test(
"main_test.go",
],
flaky = True,
shard_count = 19,
shard_count = 20,
deps = [
"//pkg/autoid_service",
"//pkg/config",
Expand Down
15 changes: 15 additions & 0 deletions pkg/executor/test/issuetest/executor_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ func TestIssue30289(t *testing.T) {
require.EqualError(t, err, "issue30289 build return error")
}

func TestIssue51998(t *testing.T) {
fpName := "github.com/pingcap/tidb/pkg/executor/join/issue51998"
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a int)")
require.NoError(t, failpoint.Enable(fpName, `return(true)`))
defer func() {
require.NoError(t, failpoint.Disable(fpName))
}()
err := tk.QueryToErr("select /*+ hash_join(t1) */ * from t t1 join t t2 on t1.a=t2.a")
require.EqualError(t, err, "issue51998 build return error")
}

func TestIssue29498(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
Expand Down

0 comments on commit c78fa3b

Please sign in to comment.