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

Server crash when a predicate inside $elemMatch value is not indexable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.5.5, 2.6.0-rc1
    • Fix Version/s: 2.6.0-rc3
    • Component/s: Querying
    • Labels:
    • Environment:
      mac os x
    • Operating System:
      OS X

      Description

      The $elemMatch value is considered indexable, causing the server to erroneously try to build index bounds for the "$size: 3" predicate.

      > t = db.t
      test.t
      > t.drop()
      2014-03-21T14:16:28.601-0400 trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
      2014-03-21T14:16:28.602-0400 reconnect 127.0.0.1:27017 (127.0.0.1) ok
      true
      > t.ensureIndex({a: 1})
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }
      > t.find({a: {$elemMatch: {$size: 3, $gt: 2}}})
      2014-03-21T14:17:02.525-0400 DBClientCursor::init call() failed
      Error: error doing query: failed

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: