slfan1989 opened a new issue, #1498:
URL: https://github.com/apache/paimon-rust/issues/1498

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/issues) and found nothing 
similar.
   
   
   ### Please describe the bug 🐞
   
   Some `UPDATE` and `DELETE` statements accept clauses that constrain which 
rows should be affected, but the execution path can ignore those clauses. This 
can modify every row in the target table even when the source is empty.
   
   ### Reproduction
   
   Run each case against a fresh copy of this setup.
   
   ```sql
   CREATE TABLE paimon.default.target (id INT, age INT);
   INSERT INTO paimon.default.target VALUES (1, 10), (2, 20);
   CREATE TABLE paimon.default.empty_source (id INT);
   ```
   
   Run one of these statements, then query the target table.
   
   ```sql
   UPDATE paimon.default.target SET age = 99 FROM paimon.default.empty_source;
   ```
   
   ```sql
   DELETE FROM paimon.default.target USING paimon.default.empty_source;
   ```
   
   ```sql
   SELECT id, age FROM paimon.default.target ORDER BY id;
   ```
   
   **Actual**
   
   - `UPDATE` succeeds and changes both rows to `age = 99`.
   - `DELETE` succeeds and removes both rows.
   
   **Expected**
   
   Both statements report that the respective clause is unsupported before 
writing. The target still contains `(1, 10)` and `(2, 20)`.
   
   ### Solution
   
   Validate row-selection clauses before dispatching UPDATE or DELETE to a 
writer. Reject unsupported joins and source clauses, multi-table DELETE, 
sampling and partition selectors on the target, and table-function targets. Add 
regression tests that verify the original rows are preserved after rejection.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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