-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance, Querying
-
Labels:None
-
Minor Change
-
ALL
f = strcmp( l.codeWScopeScopeDataUnsafe() , r.codeWScopeScopeDataUnsafe() );
1) codeWScopeScopeDataUnsafe is deprecated because it is broken
2) strcmp stops at the first NUL byte, which is (almost) guaranteed to be within the BSON size int.
3) Ideally the comparison wouldn't depend on having the scope serialized to BSON. A simple solution would be to just use the normal BSONObj::woCompare to compare the scopes.
4) (added later) The code part is also compared with strcmp rather than memcmp.
Unfortunately this requires an index rev bump to fix since someone (probably mistakenly) might have indexed a field containing CodeWScope.