SEZ9 commented on issue #12599:
URL: https://github.com/apache/seatunnel/issues/12599#issuecomment-5945452663

   Thanks for the detailed report and the reproduction. The root-cause analysis 
(Debezium `CreateTableParserListener#enterUniqueKeyTableConstraint` -> 
`MySqlAntlrDdlParser#parsePrimaryIndexColumnNames` forcing `optional(false)` on 
the promoted unique key columns) looks plausible, and since this is silent data 
corruption it is worth fixing together with #12598.
   
   A possible fix direction: after `MySqlSchema#parseSnapshotDdl` builds the 
table, re-apply nullability from the database (e.g. `SHOW CREATE TABLE` / JDBC 
metadata) for tables without a real primary key, so the value converter no 
longer substitutes the type default for NULL.
   
   Since you are willing to submit a PR, that would be great. Ideally it would 
include an IT covering both the snapshot and binlog phases for a no-PK table 
with a nullable unique key. It would also help to confirm whether the same 
issue occurs when the unique key is composite with one nullable column, so we 
can decide whether the fix should be limited to the promoted-PK path or applied 
to all unique key columns.
   
   <!-- streview-comment:1464 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to