JacobZheng0927 opened a new issue, #13036:
URL: https://github.com/apache/seatunnel/issues/13036

   ### What happened
   
   Generated DB2 JDBC upserts use `target.column <> source.column` in the `WHEN 
MATCHED AND` change guard. When the only changed field transitions from NULL to 
a value, or from a value to NULL, the comparison is UNKNOWN rather than TRUE. 
The matched row is silently left unchanged while the statement succeeds.
   
   ### Reproduction
   
   Create a DB2 table with `ID INT NOT NULL PRIMARY KEY, PAYLOAD VARCHAR(20)`. 
Insert `(1, NULL)`, then use the generated primary-key MERGE to upsert `(1, 
'value')`. The payload remains NULL. Starting with a non-NULL payload and 
upserting NULL exhibits the reverse failure. This SQL is still generated by 
current `dev` (`cec3276740d9`).
   
   ### Expected behavior
   
   NULL-to-value and value-to-NULL transitions update the matched row. Equal 
values and NULL-to-NULL remain no-ops, preserving the existing behavior for 
update triggers and timestamps. The fix should also work on DB2 10.5, where `IS 
DISTINCT FROM` is unavailable.
   


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