<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:17:36 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-8495] BinData constructor for V8 stores binary data as UTF-8, mangling it</title>
                <link>https://jira.mongodb.org/browse/SERVER-8495</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Trying to iterate a collection in the shell and perform updates on each item fails. Turns out that Mongo cannot find the item it has just read (by its _id).&lt;/p&gt;

&lt;p&gt;This is using CSGUIDs and it appears that the byte order of the BinData read is being changed within the shell. The application and other tools can still read and report the values correctly so it is most likely a problem with the shell rather than the server itself.&lt;/p&gt;</description>
                <environment>Windows</environment>
        <key id="64752">SERVER-8495</key>
            <summary>BinData constructor for V8 stores binary data as UTF-8, mangling it</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="simon@captaincodeman.com">Simon Green</reporter>
                        <labels>
                            <label>shell</label>
                    </labels>
                <created>Sun, 10 Feb 2013 01:48:13 +0000</created>
                <updated>Mon, 11 Jul 2016 17:56:26 +0000</updated>
                            <resolved>Mon, 11 Feb 2013 16:17:12 +0000</resolved>
                                    <version>2.4.0-rc0</version>
                                    <fixVersion>2.4.0-rc1</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="263194" author="auto" created="Mon, 11 Feb 2013 16:06:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-02-11T16:05:08Z&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-8297&quot; title=&quot;Remove three argument constructor from the V8 version of BinData&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-8297&quot;&gt;&lt;del&gt;SERVER-8297&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-8495&quot; title=&quot;BinData constructor for V8 stores binary data as UTF-8, mangling it&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-8495&quot;&gt;&lt;del&gt;SERVER-8495&lt;/del&gt;&lt;/a&gt; Remove 3-argument BinData constructor and callers&lt;/p&gt;

&lt;p&gt;Remove undocumented overload of the BinData constructor, and its&lt;br/&gt;
internal callers.  Do not convert binary data to UTF-8 when calling&lt;br/&gt;
BinData constructor internally.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0e0b5016ab80630666277790adbd8042b2c5bb68&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0e0b5016ab80630666277790adbd8042b2c5bb68&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="262646" author="simon@captaincodeman.com" created="Sun, 10 Feb 2013 20:26:10 +0000"  >&lt;p&gt;Thanks for the explanation Tad!&lt;/p&gt;

&lt;p&gt;I guess that&apos;s why a few of the records &lt;em&gt;did&lt;/em&gt; manage to match (they just happened to have all-legal bytes).&lt;/p&gt;</comment>
                            <comment id="262583" author="tad" created="Sun, 10 Feb 2013 18:14:18 +0000"  >&lt;p&gt;Hi Simon,&lt;/p&gt;

&lt;p&gt;Thank you for this bug report, and for the detailed steps-to-reproduce.  I was able to reproduce your problem exactly.&lt;/p&gt;

&lt;p&gt;Our interface code for the V8 JavaScript engine is storing binary data (BinData) within V8 as a UTF-8 string, which is a poor choice due to validation of UTF-8.&lt;/p&gt;

&lt;p&gt;The actual binary data in your example is:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;c4 b2 5b 6c bc 21 03 4a 99 4b 37 46 68 ae 25 ee &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;By luck, the first four bytes are legal UTF-8 and so are not recoded.  The next byte, 0xBC, would be a legal non-initial byte in a multi-byte UTF-8 encoded string, but appears by itself so it is converted to the Unicode error character U+FFFD, which is encoded in UTF-8 as EF BF BD.  This pushes the legal UTF-8 characters 21, 03 and 4A to later in the string by two bytes due to BC being converted to EF BF BD.  The same thing happens with the 0x99 byte, pushing the 4B 37 46 sequence to later in the string.  The mangled string is then truncated to 16 bytes, producing this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;c4 b2 5b 6c ef bf bd 21 03 4a ef bf bd 4b 37 46&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It is likely that this problem was not seen when this code was written because it was originally written to work with an older version of the V8 engine that did not validate UTF-8 strings.&lt;/p&gt;

&lt;p&gt;Storing the data &quot;as-is&quot; rather than as UTF-8 should fix this.  Thanks again for the report!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 10 Feb 2013 18:14:18 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 1 week, 2 days 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 1 week, 2 days 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>auto</customfieldvalue>
            <customfieldvalue>simon@captaincodeman.com</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|hrn7tb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>42373</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Execute shell script with 2.2 running:&lt;/p&gt;

&lt;p&gt;dev:PRIMARY&amp;gt; var o = db.Order.findOne()&lt;br/&gt;
dev:PRIMARY&amp;gt; var id = o._id&lt;br/&gt;
dev:PRIMARY&amp;gt; id&lt;br/&gt;
BinData(3,&quot;xLJbbLwhA0qZSzdGaK4l7g==&quot;)&lt;br/&gt;
dev:PRIMARY&amp;gt; id.toCSUUID()&lt;br/&gt;
CSUUID(&quot;6c5bb2c4-21bc-4a03-994b-374668ae25ee&quot;)&lt;br/&gt;
dev:PRIMARY&amp;gt; db.Order.findOne({_id:id},{_id:1})&lt;/p&gt;
{ &quot;_id&quot; : BinData(3,&quot;xLJbbLwhA0qZSzdGaK4l7g==&quot;) }
&lt;p&gt;dev:PRIMARY&amp;gt;&lt;/p&gt;

&lt;p&gt;CSUUID matches the GUID that C# and MongoVue see.&lt;/p&gt;

&lt;p&gt;Starting 2.4-rc0 (with the same data files) produces:&lt;/p&gt;

&lt;p&gt;dev:PRIMARY&amp;gt; var o = db.Order.findOne()&lt;br/&gt;
dev:PRIMARY&amp;gt; var id = o._id&lt;br/&gt;
dev:PRIMARY&amp;gt; id&lt;br/&gt;
BinData(3,&quot;xLJbbO+/vSEDSu+/vUs3Rg==&quot;)&lt;br/&gt;
dev:PRIMARY&amp;gt; id.toCSUUID()&lt;br/&gt;
CSUUID(&quot;6c5bb2c4-bfef-21bd-034a-efbfbd4b3746&quot;)&lt;br/&gt;
dev:PRIMARY&amp;gt; db.Order.findOne({_id:id},{_id:1})&lt;br/&gt;
null&lt;br/&gt;
dev:PRIMARY&amp;gt;&lt;/p&gt;

&lt;p&gt;NOTE: Different CSUUID and inability to find record with the _id of the record just read.&lt;/p&gt;

&lt;p&gt;Have tried repair / rebuild index.&lt;/p&gt;</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|ht04nb:</customfieldvalue>

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