Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: check the error returned by handleNoDelay #36105

Merged
merged 12 commits into from
Jul 13, 2022
Next Next commit
executor: check the error returned by handleNoDelay
Signed-off-by: zyguan <zhongyangguan@gmail.com>
  • Loading branch information
zyguan committed Jul 11, 2022
commit 7c42d35d2e11331d7da3b638155648a88f231ef0
2 changes: 1 addition & 1 deletion executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func (a *ExecStmt) Exec(ctx context.Context) (_ sqlexec.RecordSet, err error) {
return a.handlePessimisticSelectForUpdate(ctx, e)
}

if handled, result, err := a.handleNoDelay(ctx, e, isPessimistic); handled {
if handled, result, err := a.handleNoDelay(ctx, e, isPessimistic); handled || err != nil {
return result, err
}

Expand Down
13 changes: 13 additions & 0 deletions executor/explain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,3 +495,16 @@ func TestIssue35911(t *testing.T) {
// To be consistent with other operators, we should not aggregate the concurrency in the runtime stats.
require.EqualValues(t, 5, concurrency)
}

func TestIssue35105(t *testing.T) {
store, clean := testkit.CreateMockStore(t)
defer clean()
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t (a int primary key)")
tk.MustExec("insert into t values (2)")
tk.MustExec("set @@tidb_constraint_check_in_place=1")
require.Error(t, tk.ExecToErr("explain analyze insert into t values (1), (2), (3)"))
tk.MustQuery("select * from t").Check(testkit.Rows("2"))
}