Skip to content

Commit

Permalink
Update codec.go
Browse files Browse the repository at this point in the history
  • Loading branch information
wk989898 authored Jan 6, 2025
1 parent d674b2d commit e650495
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sink/codec/debezium/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,9 @@ func (c *dbzCodec) EncodeDDLEvent(
jWriter.WriteIntField("position", pos+1)
jWriter.WriteBoolField("optional", !mysql.HasNotNullFlag(flag))

autoIncrementFlag := mysql.HasAutoIncrementFlag(flag) || mysql.HasOnUpdateNowFlag(flag) && mysql.HasNotNullFlag(flag)
updateNowTimestamp:= mysql.HasOnUpdateNowFlag(flag) && jdbcType == internal.JavaSQLTypeTIMESTAMP_WITH_TIMEZONE
autoIncrementFlag := mysql.HasAutoIncrementFlag(flag) || updateNowTimestamp

jWriter.WriteBoolField("autoIncremented", autoIncrementFlag)
jWriter.WriteBoolField("generated", autoIncrementFlag)
})
Expand Down

0 comments on commit e650495

Please sign in to comment.