<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:59:03 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>[JAVA-3212] Inconsistent output between java driver and mongo shell</title>
                <link>https://jira.mongodb.org/browse/JAVA-3212</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Mongo Shell version: 4.x&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BsonBinaryReader.java#L139-L145&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BsonBinaryReader.java#L139-L145&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I have noticed this code is causing conflicts with binData from mongoshell.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;To test the issue, just create a simple document&lt;/p&gt;

{&quot;A&quot;:&#160; &quot;bin2&quot; : BinData(2, &quot;aGVsbG8=&quot;),}
&lt;p&gt; //hello&lt;/p&gt;

&lt;p&gt;Java driver fails to process it.&lt;/p&gt;</description>
                <environment></environment>
        <key id="702756">JAVA-3212</key>
            <summary>Inconsistent output between java driver and mongo shell</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="13202">Works as Designed</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="varun@varunagw.com">Varun Agrawal</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Feb 2019 12:56:38 +0000</created>
                <updated>Fri, 27 Oct 2023 13:21:05 +0000</updated>
                            <resolved>Mon, 25 Feb 2019 21:48:04 +0000</resolved>
                                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2162208" author="daniel.hatcher" created="Mon, 25 Feb 2019 21:16:06 +0000"  >&lt;p&gt;I created &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39827&quot; title=&quot;Remove \x02 Binary (Old) support from shell&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39827&quot;&gt;&lt;del&gt;SERVER-39827&lt;/del&gt;&lt;/a&gt; for the above question.&lt;/p&gt;</comment>
                            <comment id="2162020" author="varun@varunagw.com" created="Mon, 25 Feb 2019 19:28:45 +0000"  >&lt;p&gt;@Jeff Thank you. Please do let me know if you hear something from server team&lt;/p&gt;</comment>
                            <comment id="2161650" author="jeff.yemin" created="Mon, 25 Feb 2019 16:07:55 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=varun%40varunagw.com&quot; class=&quot;user-hover&quot; rel=&quot;varun@varunagw.com&quot;&gt;varun@varunagw.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The driver is following the &lt;a href=&quot;http://bsonspec.org/spec.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSON specification&lt;/a&gt;,&#160;which states this about BSON binary subtype 2:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;\x02 Binary (Old) - This used to be the default subtype, but was deprecated in favor of \x00. Drivers and tools should be sure to handle \x02 appropriately. The structure of the binary data (the byte* array in the binary non-terminal) must be an int32 followed by a (byte*). The int32 is the number of bytes in the repetition.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;All drivers treat it as a decoding error if the data does not conform to that specification.  See the drivers specification tests &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/bson-corpus/tests/binary.json#L68-L83&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a workaround, please avoid using BSON binary subtype 2.&lt;/p&gt;

&lt;p&gt;I will ask the server team follow up on this to see if this should be treated as a shell issue, or whether this is expected behavior.&lt;/p&gt;




&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="704323">SERVER-39827</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hue5vb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>