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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1
    • Component/s: Sharding
    • Labels:
      None
    • Operating System:
      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

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: