diff --git a/cdc/owner.go b/cdc/owner.go index 6b2aa2e3a15..855f2d6dedb 100644 --- a/cdc/owner.go +++ b/cdc/owner.go @@ -400,6 +400,8 @@ func (o *Owner) newChangeFeed( sinkTableInfo[j-1] = new(model.SimpleTableInfo) sinkTableInfo[j-1].TableID = tid sinkTableInfo[j-1].ColumnInfo = make([]*model.ColumnInfo, len(tblInfo.Cols())) + sinkTableInfo[j-1].Schema = table.Schema + sinkTableInfo[j-1].Table = table.Table for i, colInfo := range tblInfo.Cols() { sinkTableInfo[j-1].ColumnInfo[i] = new(model.ColumnInfo) diff --git a/cdc/sink/cdclog/s3.go b/cdc/sink/cdclog/s3.go index 4e39f6d001d..c09368838ae 100644 --- a/cdc/sink/cdclog/s3.go +++ b/cdc/sink/cdclog/s3.go @@ -330,16 +330,6 @@ func (s *s3Sink) EmitDDLEvent(ctx context.Context, ddl *model.DDLEvent) error { func (s *s3Sink) Initialize(ctx context.Context, tableInfo []*model.SimpleTableInfo) error { if tableInfo != nil { - for _, table := range tableInfo { - if table != nil { - err := s.storage.WriteFile(ctx, makeTableDirectoryName(table.TableID), nil) - if err != nil { - return errors.Annotate( - cerror.WrapError(cerror.ErrS3SinkStorageAPI, err), - "create table directory on s3 failed") - } - } - } // update log meta to record the relationship about tableName and tableID s.logMeta = makeLogMetaContent(tableInfo) diff --git a/tests/cdclog_s3/run.sh b/tests/cdclog_s3/run.sh index f6707849e0c..acc153a6481 100644 --- a/tests/cdclog_s3/run.sh +++ b/tests/cdclog_s3/run.sh @@ -51,9 +51,6 @@ function prepare() { run_cdc_server --workdir $WORK_DIR --binary $CDC_BINARY - SINK_URI="s3://logbucket/test?endpoint=http://$S3_ENDPOINT/" - - run_cdc_cli changefeed create --start-ts=$start_ts --sink-uri="$SINK_URI" } success=0 @@ -87,6 +84,11 @@ function cdclog_test() { run_sql "drop database if exists $TEST_NAME" run_sql "create database $TEST_NAME" run_sql "create table $TEST_NAME.t1 (c0 int primary key, payload varchar(1024));" + + SINK_URI="s3://logbucket/test?endpoint=http://$S3_ENDPOINT/" + + run_cdc_cli changefeed create --start-ts=0 --sink-uri="$SINK_URI" + run_sql "create table $TEST_NAME.t2 (c0 int primary key, payload varchar(1024));" run_sql "insert into $TEST_NAME.t1 values (1, 'a')"