_mongoc_cursor_new should not assert on configuration options

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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));
      

            Assignee:
            Unassigned
            Reporter:
            Christian Hergert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: