diff --git a/cdc/redo/reader/reader.go b/cdc/redo/reader/reader.go index 0b649882cea..ac45bb48a83 100644 --- a/cdc/redo/reader/reader.go +++ b/cdc/redo/reader/reader.go @@ -250,10 +250,14 @@ func (l *LogReader) ReadNextRow(ctx context.Context) (*model.RowChangedEvent, er zap.Any("columns", rowInRedoLog.Columns), zap.String("table", rowInRedoLog.Table.Table), zap.String("schema", rowInRedoLog.Table.Schema)) + cols := rowInRedoLog.Columns + if cols == nil { + cols = rowInRedoLog.PreColumns + } tableInfo := model.BuildTableInfo( rowInRedoLog.Table.Schema, rowInRedoLog.Table.Table, - rowInRedoLog.Columns, + cols, rowInRedoLog.IndexColumns) tableInfo.TableName.TableID = rowInRedoLog.Table.TableID tableInfo.TableName.IsPartition = rowInRedoLog.Table.IsPartition