Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1388

Assertion failure on $or $in empty array

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.5.4
    • Component/s: Querying
    • None
    • Environment:
      Ubuntu Lucid
    • ALL

      I'm getting an assertion failure (line db/queryutil.cpp:706) whenever "{$in: []}" appears within an $or. A nontrivial $in works fine, and "{$in: []}" works fine at the top level of the query (I've attached a transcript to illustrate this).

      The application-level workaround is obvious — if you're building a query where $in appears within $or, omit the $in if the array happens to be empty — so this isn't urgent for me (not nearly as much as $or is a lifesaver ), but it's inconvenient, and moreover this could be a much subtler issue in a bigger project with complex queries, especially if some list is "usually" empty.

        1. transcript
          2 kB
          Luke Maurer

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            jyrinx Luke Maurer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: