[CDRIVER-4316] mongoc_cursor_set_batch_size does nothing if batch size is was set as int32 Created: 20/Mar/22  Updated: 28/Oct/23  Resolved: 15/Jun/23

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.24.0

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Adrian Dole
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File regression_test.patch    
Backwards Compatibility: Fully Compatible

 Description   

Summary

A batchSize may be set on a mongoc_cursor_t in two ways.

mongoc_collection_find_with_opts allows setting batchSize through the bson_t opts. It accepts either int32 or int64.

mongoc_cursor_set_batch_size only overwrites the internally set batchSize if it was previously set as an int64.

I expect that mongoc_cursor_set_batch_size should overwrite the batchSize if it was also previously set as an int32.

Attached is a proposed regression test.

How to Reproduce

A regression test is attached.

Proposed Scope

  • Have mongoc_cursor_set_batch_size override a batchSize that was set as an int32 option.


 Comments   
Comment by Githook User [ 15/Jun/23 ]

Author:

{'name': 'Adrian Dole', 'email': 'adrian@dole.tech', 'username': 'adriandole'}

Message: CDRIVER-4316 Allow both int32 and int64 for batchSize in cursor opts (#1300)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/986316cc9d2c6e680f30095669538af96a8358a1

Generated at Wed Feb 07 21:20:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.