<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:22:41 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-50445] Return the value as double when NumberLong subtraction overflows in ExpressionSubtract</title>
                <link>https://jira.mongodb.org/browse/SERVER-50445</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &lt;tt&gt;ExpressionSubtract&lt;/tt&gt; does subtract operation on two &lt;tt&gt;long long&lt;/tt&gt; data type. This can cause an &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a28e071d22e8056781b03b1243c3961b054801b6/src/mongo/db/pipeline/expression.cpp#L4709&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;overflow&lt;/a&gt; with large numbers. The right way to do this is to use the &lt;tt&gt;DoubleDoubleSummation&lt;/tt&gt; helper that we use while adding number in &lt;tt&gt;ExpressionSum&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1448680">SERVER-50445</key>
            <summary>Return the value as double when NumberLong subtraction overflows in ExpressionSubtract</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="13201">Fixed</resolution>
                                        <assignee username="arun.banala@mongodb.com">Arun Banala</assignee>
                                    <reporter username="arun.banala@mongodb.com">Arun Banala</reporter>
                        <labels>
                            <label>qexec-team</label>
                    </labels>
                <created>Fri, 21 Aug 2020 09:57:17 +0000</created>
                <updated>Sun, 29 Oct 2023 22:04:11 +0000</updated>
                            <resolved>Tue, 3 Nov 2020 10:36:20 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                    <fixVersion>4.0.22</fixVersion>
                    <fixVersion>3.6.22</fixVersion>
                    <fixVersion>4.4.3</fixVersion>
                    <fixVersion>4.2.12</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3499689" author="xgen-internal-githook" created="Fri, 20 Nov 2020 14:43:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Return the value in double when NumberLong subtraction overflows in ExpressionSubtract&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)&lt;br/&gt;
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0236c6ae996dea4ca8dbc086dc8e61d7d7fac654&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0236c6ae996dea4ca8dbc086dc8e61d7d7fac654&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3499488" author="xgen-internal-githook" created="Fri, 20 Nov 2020 12:25:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Return the value in double when NumberLong subtraction overflows in ExpressionSubtract&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)&lt;br/&gt;
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/948e065e29ea96d6d248c50f4cfa8fb71cbcec55&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/948e065e29ea96d6d248c50f4cfa8fb71cbcec55&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3499483" author="xgen-internal-githook" created="Fri, 20 Nov 2020 12:21:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Return the value in double when NumberLong subtraction overflows in ExpressionSubtract&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)&lt;br/&gt;
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/23054195b6bf8ae84d7c06610b062f22632402fd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/23054195b6bf8ae84d7c06610b062f22632402fd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3499336" author="xgen-internal-githook" created="Fri, 20 Nov 2020 09:44:25 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Allocate expCtx on heap to avoid malloc() issue in unittests&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1b97d63858fe86d09cc7ce4d08023d0112a14253&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1b97d63858fe86d09cc7ce4d08023d0112a14253&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3498076" author="xgen-internal-githook" created="Thu, 19 Nov 2020 17:31:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Return the value in double when NumberLong subtraction overflows in ExpressionSubtract&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4375cd741ec7cec374f591e476ee452df23c2d7d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4375cd741ec7cec374f591e476ee452df23c2d7d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3473219" author="xgen-internal-githook" created="Tue, 3 Nov 2020 10:34:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50445&quot; title=&quot;Return the value as double when NumberLong subtraction overflows in ExpressionSubtract&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50445&quot;&gt;&lt;del&gt;SERVER-50445&lt;/del&gt;&lt;/a&gt; Return the value in double when NumberLong subtraction overflows in ExpressionSubtract&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3518bd82e49b6941ee7a2f3a868df40114b0d8fc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3518bd82e49b6941ee7a2f3a868df40114b0d8fc&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="1547707">DOCS-14006</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></customfieldvalue>
    <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Tue, 3 Nov 2020 10:34:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 11 weeks, 5 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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Similar to what we have mentioned for $pow, we should update the docs for $sum and $subtract to describe the overflow behaviour. &lt;br/&gt;
&lt;br/&gt;
The result will have the same type as the input except when it cannot be represented accurately in that type. In these cases:&lt;br/&gt;
&lt;br/&gt;
A 32-bit integer will be converted to a 64-bit integer if the result is representable as a 64-bit integer.&lt;br/&gt;
A 32-bit integer will be converted to a double if the result is not representable as a 64-bit integer.&lt;br/&gt;
A 64-bit integer will be converted to double if the result is not representable as a 64-bit integer.</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16942"><![CDATA[Needed]]></customfieldvalue>

                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 11 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14.0</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>arun.banala@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hy1i3z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxo45j:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3616">Query 2020-10-05</customfieldvalue>
    <customfieldvalue id="3617">Query 2020-10-19</customfieldvalue>
    <customfieldvalue id="3618">Query 2020-11-02</customfieldvalue>
    <customfieldvalue id="3619">Query 2020-11-16</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_17051" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Teams Impacted</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16944"><![CDATA[Docs]]></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|hy14db:</customfieldvalue>

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