[CDRIVER-3051] Using multi flag with mongoc_collection_update fails if retryWrites=true Created: 29/Mar/19 Updated: 28/Oct/23 Resolved: 03/Apr/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.10.0 |
| Fix Version/s: | 1.15.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Jeremy Mikola |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
When the MONGOC_UPDATE_MULTI_UPDATE update flag is used with mongoc_collection_update(), it fails to set the has_multi_write flag on the constructed mongoc_write_command_t. This causes _mongoc_write_opmsg() to set allow_txn_number to "yes" and the server returns a command error for including a txnNumber field in a multi-write. This bug was only caught by test_example_53() in test-mongoc-sample-commands.c (documentation examples), so I think we should also add a proper test in test-mongoc-collection.c. |
| Comments |
| Comment by Githook User [ 03/Apr/19 ] |
|
Author: {'name': 'Jeremy Mikola', 'username': 'jmikola', 'email': 'jmikola@gmail.com'}Message: If has_multi_write is not set, a 3.6+ server will return an error when This also adds new tests for the UPSERT and MULTI_UPDATE flags. |