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

_mongoc_cursor_new should not assert on configuration options

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            christian.hergert@10gen.com Christian Hergert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: