diff --git a/pkg/ddl/db_test.go b/pkg/ddl/db_test.go index 313f0f6489f48..8f702aa25c7e3 100644 --- a/pkg/ddl/db_test.go +++ b/pkg/ddl/db_test.go @@ -1098,3 +1098,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 074506df392b5..3cf938d33c250 100644 --- a/pkg/ddl/ddl_worker.go +++ b/pkg/ddl/ddl_worker.go @@ -440,7 +440,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