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

Division by 0 in dataSize command when collection has zero records

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11
    • Affects Version/s: 3.0.0
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • TIG 18 (08/05/16)
    • 0

      This bug has been present since 3.0.0. It affects the WiredTiger storage engine, but not the ephemeralForTest and mmapv1 storage engines.

      dbcommands.cpp:

      838    long long avgObjSize = collection->dataSize(txn) / collection->numRecords(txn);
      

      collection->numRecords() can return 0.

            Assignee:
            isabella.siu@mongodb.com Isabella Siu (Inactive)
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: