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

sharded count can return a negative value if a negative limit is supplied

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.1.1
    • None
    • Sharding
    • None
    • ALL

    Description

      On mongod if a count is < 0 we bracket it up to 0. On mongos we just take the value of applySkipLimit, which can be < 0 if limit < 0.

                      total = applySkipLimit( total , cmdObj );
                      result.appendNumber( "n" , total );
                      BSONObjBuilder temp( result.subobjStart( "shards" ) );
                      for ( map<string,long long>::iterator i=shardCounts.begin(); i!=shardCounts.end(); ++i )
                          temp.appendNumber( i->first , i->second );
                      temp.done();
                      return true;

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: