Skip to content

Commit bf38943

Browse files
author
ffffwh
committed
fix a panic #875
1 parent 86aa78f commit bf38943

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/mysql/mysql/binlog/binlog_reader.go

+4
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,11 @@ func (b *BinlogReader) loadMapping(sql, currentSchema string,
769769
b.logger.Debug(msg, "from", oldName, "to", newName)
770770
}
771771

772+
// will do nothing if `table` is nil
772773
renameAstTableFn := func(table *ast.TableName) {
774+
if table == nil {
775+
return
776+
}
773777
table.Schema = model.NewCIStr(g.StringElse(table.Schema.String(), currentSchema))
774778
newSchemaName := schemasRenameMap[table.Schema.String()]
775779
tableNameMap := oldSchemaNameToTablesRenameMap[table.Schema.String()]

0 commit comments

Comments
 (0)