[CDRIVER-297] _mongoc_cursor_new should not assert on configuration options Created: 17/Mar/14  Updated: 03/May/17  Resolved: 17/Mar/14

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

Type: Bug Priority: Major - P3
Reporter: Christian Hergert Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There are some assertions in _mongoc_cursor_new that could be hit if the URI was dynamically set (or from a configuration file) in the users application.

It should instead set a permanent error and return a valid cursor and then fail on the first call to _next().

snip ...

101    /*
102     * TODO: These two following assertions should be runtime catchable since
103     *       they rely on system configuration that could be dynamic.
104     *       Change to set internal error and return a valid cursor that
105     *       fails on first _next() call.
106     */
107 
108    /* we can't have exhaust queries with limits */
109    BSON_ASSERT (!((flags & MONGOC_QUERY_EXHAUST) && limit));
110 
111    /* we can't have exhaust queries with sharded clusters */
112    BSON_ASSERT (!((flags & MONGOC_QUERY_EXHAUST) && client->cluster.isdbgrid));



 Comments   
Comment by Christian Hergert [ 17/Mar/14 ]

Fixed in https://github.com/mongodb/mongo-c-driver/commit/e6038636bcee5264a264b54afce0b93c39884d97

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