[SERVER-5684] Possible number truncation in query.cpp? Created: 23/Apr/12 Updated: 11/Jul/16 Resolved: 30/Apr/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 2.1.0 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Randolph Tan | Assignee: | Randolph Tan |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Code snippet below is from queryWithQueryOptimizer @ ops/query.cpp and it tries to cast long long to int and assign it to a long long:
|
| Comments |
| Comment by auto [ 30/Apr/12 ] |
|
Author: {u'login': u'amcfague', u'name': u'Andrew McFague', u'email': u'redmumba@gmail.com'}Message: Since curop.debug().nscanned is a `long long`, and the return of the Signed-off-by: Randolph Tan <randolph@10gen.com> |
| Comment by Andrew McFague [ 30/Apr/12 ] |
|
Sounds like something left from when it was actually an integer; that's the only logic I can see. I have updated to (a) remove the cast, and (b) correctly identify the constant `0` as a `long long` (even though this will be correct cast normally). Submitted a pull request here: https://github.com/mongodb/mongo/pull/218 |