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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • 2.5.5, 2.6.0-rc1
    • 2.6.0-rc3
    • Querying
    • mac os x
    • 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

              david.storch@mongodb.com David Storch
              sduan Steve Duan
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: