[SERVER-25187] Division by 0 in dataSize command when collection has zero records Created: 20/Jul/16  Updated: 13/Aug/16  Resolved: 25/Jul/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.0.0
Fix Version/s: 3.3.11

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Isabella Siu (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 18 (08/05/16)
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 25/Jul/16 ]

Author:

{u'name': u'iwysiu', u'email': u'isabella.siu@10gen.com'}

Message: SERVER-25187 fix division by 0 in dataSize command
Branch: master
https://github.com/mongodb/mongo/commit/10aa5607565b9a9b00d999ea5083e601ad476876

Generated at Thu Feb 08 04:08:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.