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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • ALL

      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;
      

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

              Created:
              Updated:
              Resolved: