<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:26:14 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-74002] Day-of-year (%j) parsing inconsistency</title>
                <link>https://jira.mongodb.org/browse/SERVER-74002</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When I specify both&#160;&lt;tt&gt;%j&lt;/tt&gt;&#160;for day of year and&#160;&lt;tt&gt;%m&lt;/tt&gt;&#160;for month&#160;{&lt;tt&gt;&apos;$dateFromString&apos;: {&apos;dateString&apos;: &apos;2007-01-11&apos;, &apos;format&apos;: &apos;%Y-%j-%m&apos;&lt;/tt&gt;}}&#160;(note the order), the result is&#160;&lt;tt&gt;2007-11-02T00:00:00.000Z&lt;/tt&gt;&#160;-&#160;&lt;tt&gt;$j&lt;/tt&gt;&#160;is treated like&#160;&lt;tt&gt;$d&lt;/tt&gt;&#160;(but with an initial value of 0).&lt;/p&gt;

&lt;p&gt;If I specify&#160;&lt;tt&gt;%Y-%j-%m-%d&lt;/tt&gt;&#160;(input&#160;&lt;tt&gt;2007-01-11-05&lt;/tt&gt;),&#160;&lt;tt&gt;%j&lt;/tt&gt;&#160;is ignored, and the result is&#160;&lt;tt&gt;2007-11-05T00:00:00.000Z&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;The strings &quot;%Y-%m-%d-%j&quot; and &quot;%Y-%j-%m-%d&quot; give different results for the same (re-ordered) values.&lt;/p&gt;

&lt;p&gt;Since it is always an error to specify a day of year together with either a month or day of month, I would expect an error (similar to how we treat potentially incompatible timezones).&lt;/p&gt;</description>
                <environment></environment>
        <key id="2264620">SERVER-74002</key>
            <summary>Day-of-year (%j) parsing inconsistency</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="kyle.suarez@mongodb.com">Kyle Suarez</assignee>
                                    <reporter username="maxim.katcharov@mongodb.com">Maxim Katcharov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Feb 2023 18:48:30 +0000</created>
                <updated>Thu, 30 Mar 2023 20:12:20 +0000</updated>
                            <resolved>Thu, 30 Mar 2023 20:12:20 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5271200" author="JIRAUSER1257467" created="Tue, 14 Mar 2023 15:03:32 +0000"  >&lt;p&gt;Assigning this to you &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kyle.suarez%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kyle.suarez@mongodb.com&quot;&gt;kyle.suarez@mongodb.com&lt;/a&gt; to raise DOCS ticket&lt;/p&gt;</comment>
                            <comment id="5256508" author="kyle.suarez" created="Tue, 7 Mar 2023 19:38:54 +0000"  >&lt;p&gt;After discussion with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kateryna.kamenieva%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kateryna.kamenieva@mongodb.com&quot;&gt;kateryna.kamenieva@mongodb.com&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=amr.elhelw%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;amr.elhelw@mongodb.com&quot;&gt;amr.elhelw@mongodb.com&lt;/a&gt; and others at the needs triage meeting, we don&apos;t feel that the engineering effort is worth fixing this ambiguous case.&lt;/p&gt;

&lt;p&gt;I will file a DOCS ticket to consider documenting the undefined behavior.&lt;/p&gt;</comment>
                            <comment id="5198344" author="JIRAUSER1258420" created="Tue, 14 Feb 2023 19:16:19 +0000"  >&lt;p&gt;I see a few options for resolving this.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;We could resolve it on the mongo side, the way we do when &lt;a href=&quot;https://github.com/10gen/mongo/blob/7165ae9350e3e9bd9b77a74cf3a36b5a038de6fa/src/mongo/db/query/datetime/date_time_support.cpp#L304-L321&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;conflicting timezone information&lt;/a&gt; is specified. However, conflicting timezones are a result of an &lt;a href=&quot;https://github.com/10gen/mongo/blob/7165ae9350e3e9bd9b77a74cf3a36b5a038de6fa/src/mongo/db/query/datetime/date_time_support.cpp#L221&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;argument&lt;/a&gt; passed to fromString conflicting with information inside the string we&apos;re parsing to a date. This, on the other hand, is a conflict between two format specifiers both setting the same field.&lt;/li&gt;
	&lt;li&gt;We could try to resolve this on the timelib side by having %m surface an error if the month has previously been set (same for %d, %j, etc.) This seems like the cleaner approach as long as it does not cause any performance issues. However, this could conflict with existing design decisions for timelib, and would potentially be a breaking change.&lt;/li&gt;
	&lt;li&gt;We could live with this silent bug, citing that we do not make guarantees for the parsing behavior of invalid date formats.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;cc &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=arun.banala%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;arun.banala@mongodb.com&quot;&gt;arun.banala@mongodb.com&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kyle.suarez%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kyle.suarez@mongodb.com&quot;&gt;kyle.suarez@mongodb.com&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5198319" author="JIRAUSER1258420" created="Tue, 14 Feb 2023 19:08:52 +0000"  >&lt;p&gt;When we call &lt;a href=&quot;https://github.com/10gen/mongo/blob/7165ae9350e3e9bd9b77a74cf3a36b5a038de6fa/src/mongo/db/query/datetime/date_time_support.cpp#L220&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dateFromString&lt;/a&gt;, we call a function &lt;a href=&quot;https://github.com/10gen/mongo/blob/7165ae9350e3e9bd9b77a74cf3a36b5a038de6fa/src/mongo/db/query/datetime/date_time_support.cpp#L241&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;from timelib&lt;/a&gt; and pass along the date &lt;a href=&quot;https://github.com/derickr/timelib/blob/22c62589c366d1621f5254d2f33fe185a7f2667b/parse_date.re#L2245-L2262&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;it returns&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The reason this behavior occurs is because timelib loops over the format specifiers one by one, and does not check that each one it is processing has no conflicts with values that have already been set.&lt;/p&gt;

&lt;p&gt;So in the case of {&lt;tt&gt;&apos;$dateFromString&apos;: {&apos;dateString&apos;: &apos;2007-01-11&apos;, &apos;format&apos;: &apos;%Y-%j-%m&apos;&lt;/tt&gt;}}, timelib:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;sees %Y and sets the year to 2007.&lt;/li&gt;
	&lt;li&gt;sees %j and sets m = 1, d = (1+1) = 2.&lt;/li&gt;
	&lt;li&gt;sees %m and sets m = 11&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In other words, %m overrides the month that was previously set by %j, but the day remains unchanged.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;%Y-%j-%m-%d&lt;/tt&gt;&#160;behaves as if it ignores %j because %m overwrites the month and %d overwrites the day. But in &lt;tt&gt;%Y-%m-%d-%j&lt;/tt&gt;, %j overwrites what both %m and %d have set.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1444242">SERVER-50336</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 14 Feb 2023 19:08:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        47 weeks, 1 day 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>kyle.suarez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            47 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ana.meza@mongodb.com</customfieldvalue>
            <customfieldvalue>jennifer.peshansky@mongodb.com</customfieldvalue>
            <customfieldvalue>kyle.suarez@mongodb.com</customfieldvalue>
            <customfieldvalue>maxim.katcharov@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1w0e7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1egb4:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6990">QE 2023-03-06</customfieldvalue>
    <customfieldvalue id="6992">QE 2023-03-20</customfieldvalue>
    <customfieldvalue id="6994">QE 2023-04-03</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|i1vmjj:</customfieldvalue>

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