Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Nov 2, 2023
1 parent 0ec1f67 commit 88638df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cdc/model/changefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ func (info *ChangeFeedInfo) VerifyAndComplete() {
if info.Config.ChangefeedErrorStuckDuration == nil {
info.Config.ChangefeedErrorStuckDuration = defaultConfig.ChangefeedErrorStuckDuration
}
if info.Config.SQLMode == "" {
info.Config.SQLMode = defaultConfig.SQLMode
}
info.RmUnusedFields()
}

Expand Down
9 changes: 8 additions & 1 deletion cdc/owner/ddl_sink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/pingcap/errors"
"github.com/pingcap/tiflow/cdc/model"
"github.com/pingcap/tiflow/cdc/sink/ddlsink"
"github.com/pingcap/tiflow/pkg/config"
cerror "github.com/pingcap/tiflow/pkg/errors"
"github.com/pingcap/tiflow/pkg/retry"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -61,7 +62,13 @@ func (m *mockSink) GetDDL() *model.DDLEvent {

func newDDLSink4Test(reportErr func(err error), reportWarn func(err error)) (DDLSink, *mockSink) {
mockSink := &mockSink{}
ddlSink := newDDLSink(model.DefaultChangeFeedID("changefeed-test"), &model.ChangeFeedInfo{}, reportErr, reportWarn)
ddlSink := newDDLSink(
model.DefaultChangeFeedID("changefeed-test"),
&model.ChangeFeedInfo{
Config: config.GetDefaultReplicaConfig(),
},
reportErr,
reportWarn)
ddlSink.(*ddlSinkImpl).sinkInitHandler = func(ctx context.Context, s *ddlSinkImpl) error {
s.sink = mockSink
return nil
Expand Down

0 comments on commit 88638df

Please sign in to comment.