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

Invalid sorting of infinity and -infinity

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.9.1
    • Component/s: Index Maintenance, Querying
    • Labels:
      None
    • Environment:
      Linux (Ubuntu 9.10 on Asus Eee PC 901)
    • Backwards Compatibility:
      Minor Change

      Description

      Sorting of infinity and -infinity does not produce expected results:

      > db.test.save(

      {number: 1}

      )
      > db.test.save(

      {number: 2}

      )
      > db.test.save(

      {number: 3}

      )
      > db.test.save(

      {number: Infinity}

      )
      > db.test.save(

      {number: -Infinity}

      )
      > db.test.find().sort(

      {"number": 1}

      )

      { "_id" : ObjectId("4bbdd056ac64d9763fe0bccf"), "number" : Infinity } { "_id" : ObjectId("4bbdd059ac64d9763fe0bcd0"), "number" : -Infinity } { "_id" : ObjectId("4bbdd04dac64d9763fe0bccc"), "number" : 1 } { "_id" : ObjectId("4bbdd04fac64d9763fe0bccd"), "number" : 2 } { "_id" : ObjectId("4bbdd051ac64d9763fe0bcce"), "number" : 3 }

      The expected order is [-Infinity, 1, 2, 3, Infinity].

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dwight_10gen Dwight Merriman
              Reporter:
              tomikall Tomi Kallio
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: