Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Duplicate
-
1.8.2, 1.9.2
-
None
-
None
-
Tested on Vista
-
ALL
Description
For QA-3, attempted to verify SERVER-1300 using the following:
db = db.getSiblingDB("qadb");
db.mns.drop();
db.mns.save(
);
db.mns.save(
);
db.mns.save(
);
db.mns.save(
);
db.mns.save(
);
db.mns.save(
);
db.mns.ensureIndex(
);
var r = db.mns.find().sort(
{s:1});
The result in 1.9.2 is
> r
{ "_id" : ObjectId("4e4a97d2f1c165e78e8abf66"), "i" : 2, "s" : "abcde" } { "_id" : ObjectId("4e4a97d2f1c165e78e8abf68"), "i" : 4, "s" : "abcdefghijklm" } { "_id" : ObjectId("4e4a97d2f1c165e78e8abf67"), "i" : 3, "s" : "abcdefghijklm" } { "_id" : ObjectId("4e4a97d2f1c165e78e8abf69"), "i" : 5, "s" : "abcdefghijklmnop qrst" } { "_id" : ObjectId("4e4a97d2f1c165e78e8abf6a"), "i" : 6, "s" : "abcdefghijklmnop qrstuvwx" } { "_id" : ObjectId("4e4a97d2f1c165e78e8abf65"), "i" : 1, "s" : "abcdefghijklmnop qrstuvwxyz" }Since we can't retrieve these strings, what's the point of worrying about the sort?
Note this isn't a JavaScript issue, because you can create such strings and get them in the shell:
> a = 'abcdef\0ghijklm'
abcdef ghijklm
> a
abcdef ghijklm
>
Attachments
Issue Links
- duplicates
-
SERVER-6646 Strings with NUL bytes don't round-trip correctly from BSON <-> JavaScript
-
- Closed
-
- is related to
-
SERVER-1300 use memcmp, not strcmp for comparing BSON strings
-
- Closed
-