-
Bug
-
Resolution: Done
-
Critical
-
0.9.5.Final
-
None
There's a relational issue DBZ-771, it solved the bug when execute statement alter table change about default value,
but, statement alter table modify also cause the same issue.
Just extend DBZ-771's test case,
io.debezium.connector.mysql.MysqlDefaultValueIT.columnTypeChangeResetsDefaultValue(),
continue execute these two SQLs
alter table DBZ_771_CUSTOMERS modify customer_type int null; alter table DBZ_771_CUSTOMERS modify customer_type int not null;
will cause Exception:
...... Caused by: org.apache.kafka.connect.errors.DataException: Invalid value: null used for required field: "null", schema type: INT32 at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:220) at org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:213) at org.apache.kafka.connect.data.SchemaBuilder.defaultValue(SchemaBuilder.java:129) ... 19 more
Caz after apply alter table DBZ_771_CUSTOMERS modify customer_type int not null; this column definition is customer_type int not null default value null;, it should reset default value just same as parsing alter table change