<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:09 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>[CDRIVER-2414] bson_iter{_init}_find should have length taking overloads</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2414</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;If you have a string held in not-guaranteed-null-terminated storage, you cannot currently use that string directly to search within a &lt;tt&gt;bson_t&lt;/tt&gt; with &lt;tt&gt;bson_iter_find&lt;/tt&gt; or &lt;tt&gt;bson_iter_init_find&lt;/tt&gt;, and instead must heap allocate a known-to-be-null-terminated temporary string to pass in.&lt;/p&gt;

&lt;p&gt;The C++ driver stopped using &lt;tt&gt;bson_iter_init_find&lt;/tt&gt; in &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-992&quot; title=&quot;bsoncxx::document::view::find() should be rewritten to avoid string allocation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-992&quot;&gt;&lt;del&gt;CXX-992&lt;/del&gt;&lt;/a&gt; to avoid the overhead of this temporary allocation, and began walking and comparing keys directly. Unfortunately, the implementation was buggy, leading to &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1476&quot; title=&quot;Element search stops prematurely due to missing string length check&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1476&quot;&gt;&lt;del&gt;CXX-1476&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the two forms of find had overloads that took an associated length for the key, then the C++ driver could use those rather than re-implementing key comparison itself.&lt;/p&gt;

&lt;p&gt;If this is not viable for some reason, an alternative would be to make an overload of &lt;tt&gt;bson_iter_key&lt;/tt&gt; that returned the key length in an out parameter. This would allow the C++ driver to avoid a required (though currently not present) call to &lt;tt&gt;strlen&lt;/tt&gt; on the result of &lt;tt&gt;bson_iter_key&lt;/tt&gt;, which is almost certainly redundant work to recover information that the C driver has already determined.&lt;/p&gt;

&lt;p&gt;It may make sense to implement the length returning form of &lt;tt&gt;bson_iter_key&lt;/tt&gt; even if the &lt;tt&gt;bson_iter_find&lt;/tt&gt; changes are made anyway, as searching in BSON is very common, and the C driver should surface all information available that may assist clients.&lt;/p&gt;</description>
                <environment></environment>
        <key id="467407">CDRIVER-2414</key>
            <summary>bson_iter{_init}_find should have length taking overloads</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="13201">Fixed</resolution>
                                        <assignee username="xiangyu.yao@mongodb.com">Xiangyu Yao</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Sat, 2 Dec 2017 21:39:05 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:16 +0000</updated>
                            <resolved>Tue, 26 Dec 2017 19:23:15 +0000</resolved>
                                                    <fixVersion>1.10.0</fixVersion>
                                    <component>libbson</component>
                    <component>Performance</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1752461" author="xgen-internal-githook" created="Thu, 14 Dec 2017 20:50:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Xiangyu Yao&apos;, &apos;email&apos;: &apos;xiangyu.yao24@gmail.com&apos;, &apos;username&apos;: &apos;xy24&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2414&quot; title=&quot;bson_iter{_init}_find should have length taking overloads&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2414&quot;&gt;&lt;del&gt;CDRIVER-2414&lt;/del&gt;&lt;/a&gt; add bson_iter_&lt;span class=&quot;error&quot;&gt;&amp;#91;find/init_find&amp;#93;&lt;/span&gt;_w_len functions&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/39debee5295997726e66efc15dbde8df23af142d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/39debee5295997726e66efc15dbde8df23af142d&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="486266">CXX-1500</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="463518">CXX-1476</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="308651">CXX-992</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="457260">CDRIVER-2360</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <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_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-2632</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htd2e7:</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>