diff --git a/pkg/ddl/db_test.go b/pkg/ddl/db_test.go index 12480470bec5f..e29633fb960f0 100644 --- a/pkg/ddl/db_test.go +++ b/pkg/ddl/db_test.go @@ -1063,3 +1063,20 @@ func TestMDLTruncateTable(t *testing.T) { require.True(t, timetk2.After(timeMain)) require.True(t, timetk3.After(timeMain)) } + +func TestDDLJobErrEntrySizeTooLarge(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + + tk.MustExec("use test") + tk.MustExec("create table t (a int);") + + require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/ddl/mockErrEntrySizeTooLarge", `1*return(true)`)) + t.Cleanup(func() { + require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/ddl/mockErrEntrySizeTooLarge")) + }) + + tk.MustGetErrCode("rename table t to t1;", errno.ErrEntryTooLarge) + tk.MustExec("create table t1 (a int);") + tk.MustExec("alter table t add column b int;") // Should not block. +} diff --git a/pkg/ddl/ddl_worker.go b/pkg/ddl/ddl_worker.go index ddac2e13ddce6..99922651794ca 100644 --- a/pkg/ddl/ddl_worker.go +++ b/pkg/ddl/ddl_worker.go @@ -554,7 +554,6 @@ func (w *worker) handleUpdateJobError(t *meta.Meta, job *model.Job, err error) e } // Reduce this txn entry size. job.BinlogInfo.Clean() - job.InvolvingSchemaInfo = nil job.Error = toTError(err) job.ErrorCount++ job.SchemaState = model.StateNone