Files
documentdb/pg_helio_api
Vinod Sridharan 6169cfd57a Merged PR 1532251: [Update] Only do Upsert if the query is on _id
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Fix up update to only do upsert if the query was exactly on _id. other cases should defer to insert (and fail on unique conflict)

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to ensure upsert operations are only performed when the query is on `_id`.

#### PR Summary
This pull request modifies the upsert logic to only perform upserts if the query is solely based on the `_id` field.
- Updated `update.c` to check for queries with only `_id` filters and renamed related variables for clarity.
- Added test cases in `commands_update.out` and `commands_update.sql` to verify upsert behavior and handle error cases.
2024-12-16 11:37:44 +08:00
..