<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:08:58 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-5462] Shell doesn&apos;t handle embedded nulls correctly</title>
                <link>https://jira.mongodb.org/browse/SERVER-5462</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&amp;gt; db.test.insert(&lt;/p&gt;
{&apos;x&apos;: &apos;y\u0000a&apos;}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.find()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4f75db6d5b92cfb811975759&quot;), &quot;x&quot; : &quot;y&quot; }
&lt;p&gt;&amp;gt; db.test.find()&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;.x.length&lt;br/&gt;
1&lt;/p&gt;

&lt;p&gt;The shell sends the string to the backend correctly, and the backend stores the data correctly (it&apos;s retrieved properly in Python), but the data received is truncated.  x.length is 1, so this isn&apos;t a cosmetic problem in the shell; the data is actually incorrect.&lt;/p&gt;</description>
                <environment></environment>
        <key id="35108">SERVER-5462</key>
            <summary>Shell doesn&apos;t handle embedded nulls correctly</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="glenn">Glenn Maynard</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Mar 2012 16:20:52 +0000</created>
                <updated>Thu, 29 Aug 2013 19:01:16 +0000</updated>
                            <resolved>Fri, 8 Mar 2013 06:32:27 +0000</resolved>
                                    <version>2.0.3</version>
                                                    <component>JavaScript</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="106623" author="glenn" created="Wed, 4 Apr 2012 18:26:02 +0000"  >&lt;p&gt;In general, Mongo should try to minimize the number of places where valid JSON/BSON can&apos;t be stored directly.  Currently, all of the &lt;b&gt;intentional&lt;/b&gt; restrictions (that I&apos;m aware of) are key restrictions: object (document) keys can&apos;t contain &quot;.&quot;, &quot;\0&quot;, or begin with &quot;$&quot;.  Each of these restrictions gives me extra work: I need to ensure that my higher-level API doesn&apos;t require these, documents that they&apos;re not allowed where that leaks through to the API (which doesn&apos;t expose MongoDB per se) or else escape them; add tests for these exceptional cases, and so on.  Having additional limitations like &quot;document &lt;b&gt;values&lt;/b&gt; can&apos;t contain nul&quot; gives me more work to do and complicates my API (because now it has more special cases, too).&lt;/p&gt;

&lt;p&gt;Also, as far as I&apos;m aware, all of the intentional restrictions are limitations on keys, not values, which helps narrow it a bit.  You only need to worry about special limitations in object keys; everything else is simply any valid JSON (BSON) object.&lt;/p&gt;

&lt;p&gt;The closest to a use case I have is simply the desire for (valid) Unicode strings coming into my API to always round-trip back out again, even if they contain rare control characters like NUL.&lt;/p&gt;</comment>
                            <comment id="106596" author="tad" created="Wed, 4 Apr 2012 17:59:14 +0000"  >&lt;p&gt;Hi Glenn,&lt;/p&gt;

&lt;p&gt;Thanks for the report.  I haven&apos;t even tried to reproduce it yet but your steps are clean and simple (and appreciated!)&lt;/p&gt;

&lt;p&gt;We have a bit of confusion in our code over whether (and when) a NUL terminator actually terminates a string.  NUL is a perfectly valid ASCII and Unicode character but it is also (as you know) widely used as a terminator for a string of characters and there is a lot of code that expects and demands this.&lt;/p&gt;

&lt;p&gt;Can you give a use case for storing and retrieving embedded NULs in UTF-8 strings in MongoDB and/or a set of rules that you would like us to follow here?  I&apos;m not trying to be difficult, and if Python sees a different string length than JavaScript sees then there is clearly something that needs fixing, but I would love to see your thoughts on what &quot;correct&quot; behavior would be here.&lt;/p&gt;

&lt;p&gt;Thanks for your help!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="45792">SERVER-6646</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 4 Apr 2012 17:59:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 46 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 46 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>glenn</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hro7mv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hriaqv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20386</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hssvq7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>