[SERVER-3614] strings with embedded nulls cannot be retrieved correctly Created: 16/Aug/11 Updated: 29/Aug/13 Resolved: 08/Mar/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 1.8.2, 1.9.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Pasette (Inactive) | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Tested on Vista |
||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
For QA-3, attempted to verify db = db.getSiblingDB("qadb"); db.mns.drop(); ); ); ); ); ); ); ); 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: |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ] |
|
Best thing to do is add a test in dbtests/jstests.cpp that shows problem |
| Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ] |
|
That just tests js -> js |
| Comment by Chris Westin [ 16/Aug/11 ] |
|
I suppose it could be, but that last example (setting a string-value variable to a string with an embedded null) seems to indicate that the shell can handle this. |
| Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ] |
|
What do you mean can't retrieve them? |