Skip to content

Commit 4927ef0

Browse files
hongyunyanlidezhu
authored andcommitted
dispatcher: Fix panic due to nil tableInfo in ddl event (#3670)
close #3669
1 parent fb0b1c1 commit 4927ef0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/common/event/util.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ func BatchDML(dml *DMLEvent) *BatchDMLEvent {
494494
// Only the table with pk and no uk can always be splitted in all sinks.
495495
// Notice: please ensure the logic of IsSplitable is totally the same with isSplitable in utils
496496
func IsSplitable(tableInfo *common.TableInfo) bool {
497+
// some ddl jobs do not have table info, such as drop database, we just ignore checking these jobs
498+
if tableInfo == nil {
499+
return true
500+
}
501+
497502
if tableInfo.GetPkColInfo() == nil {
498503
return false
499504
}

0 commit comments

Comments
 (0)