Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3477

_mongoc_bulk_operation_update_append does not update has_array_filters for subsequent update operations

      CDRIVER-2664 added tracking of arrayFilters in c4af4aa so that an error could be raised if the option was used for unsupported servers. While implementing support for the hint option in CDRIVER-3400, I realized that _mongoc_bulk_operation_update_append only appears to set mongoc_write_command_t.flags.has_array_filters when initializing a new update command in the bulk. This is in contract to the existing has_collation and has_multi_write flags, which are also updated with an |= assignment when appending an update operation to an existing update command.

      Assuming this was an oversight, I think the appropriate test would be to execute a bulk write with two updates against a <3.6 server when only the second update uses arrayFilters. The driver should raise a client-side error to conform with the CRUD specification. Rather than implement this as a prose test specific to the C driver, it may make sense to contribute it directly to the specifications repo so all drivers can benefit.

            Assignee:
            roberto.sanchez@mongodb.com Roberto Sanchez
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: