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

   Thanks @CodeWithPravinMaske, and thanks for confirming the composite case — 
`UNIQUE KEY (a, b)` with `a NOT NULL` and `b` nullable having `b`'s NULLs 
emitted as `0` in both snapshot and binlog is exactly the symptom this issue is 
about, so it's good that your fix covers it rather than just the single-column 
case.
   
   Re-applying column nullability from the catalog table after 
`parseSnapshotDdl` sounds like the right place to correct what the Debezium DDL 
parser does when it promotes the unique key to a primary key. A few things I'd 
like to see before we can move this forward:
   
   1. Please link the PR on this thread — I don't see a reference to it here 
yet, so I can't look at it.
   2. In the PR, please make sure the fix only restores nullability for columns 
the database reports as nullable, and does not touch a genuinely `NOT NULL` 
primary-key column. A control test with a real primary key and one with a 
non-null unique key would make that explicit alongside the nullable 
single-column and composite cases you already cover.
   3. For the IT, please confirm the sink-side assertion distinguishes SQL 
`NULL` from the type default `0` for both the snapshot and binlog phases — that 
is the core of the bug, so an assertion that would pass with either value 
wouldn't prove it.
   
   Once the PR is linked I'll take a look. Appreciate you digging into this and 
verifying on MySQL 8.0.
   
   <!-- streview-comment:1478 -->


-- 
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