<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:29:06 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-75014] Unify format validation for $dateToString and $dateFromString in SBE</title>
                <link>https://jira.mongodb.org/browse/SERVER-75014</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In the classic engine, $dateToString and $dateFromString were validated using the &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/query/datetime/date_time_support.cpp#L674-L680&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;validate...Format&lt;/a&gt; functions in date_time_support.cpp, which were void functions that would uassert if an invalid format was detected.&lt;/p&gt;

&lt;p&gt;When implementing $dateToString in SBE in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-49979&quot; title=&quot;Support expression $dateToString in SBE&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-49979&quot;&gt;&lt;del&gt;SERVER-49979&lt;/del&gt;&lt;/a&gt;, we added &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/query/datetime/date_time_support.cpp#L666-L672&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;isValid...Format functions&lt;/a&gt; which do not uassert, and instead return a boolean indicating whether the format is valid. We created a new vm builtin, &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/exec/sbe/vm/vm.cpp#L4086-L4097&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;builtinIsValidToStringFormat&lt;/a&gt; to call this function &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/query/sbe_stage_builder_expression.cpp#L1658&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;from the stage builder&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;However, while implementing $dateFromString in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-49978&quot; title=&quot;Support expression $dateFromString in SBE&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-49978&quot;&gt;&lt;del&gt;SERVER-49978&lt;/del&gt;&lt;/a&gt;, we decided to add a builtin called validateFromStringFormat instead, which calls &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/query/datetime/date_time_support.cpp#L678-L680&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;TimeZone::validateFromStringFormat&lt;/a&gt;, allows it to uassert, and returns true otherwise. Since it had recently been decided that it was alright for SBE VM functions to uassert, we determined it was more important to have detailed errors than a validation function that returns a true/false value.&lt;/p&gt;

&lt;p&gt;This ticket should, at a minimum, involve updating dateToString format validation to function in the same way, where detailed errors can be surfaced from uasserts within date_time_support. &lt;/p&gt;

&lt;p&gt;We should also consider either deleting the new isValid...Format functions inside the date_time_support library, or modifying them so that they can run the validation function, uassert, but still return a true/false value, so the SBE builtins can simply return TimeZone::isValid...StringFormat. &lt;/p&gt;

&lt;p&gt;It&apos;s possible &lt;a href=&quot;https://github.com/10gen/mongo/blob/1a7ef47ac1b71936d4f0e671aa1037e4467457cd/src/mongo/db/query/datetime/date_time_support.cpp#L121-L122&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the function where the actual validation happens&lt;/a&gt;, which was made into a templated function during &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-49978&quot; title=&quot;Support expression $dateFromString in SBE&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-49978&quot;&gt;&lt;del&gt;SERVER-49978&lt;/del&gt;&lt;/a&gt; to allow the option to suppress errors, can go back to a simple function without a template that always uasserts on an invalid format.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2291628">SERVER-75014</key>
            <summary>Unify format validation for $dateToString and $dateFromString in SBE</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="jennifer.peshansky@mongodb.com">Jennifer Peshansky</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Mar 2023 21:01:19 +0000</created>
                <updated>Tue, 21 Mar 2023 18:49:42 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1423930">SERVER-49978</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1423932">SERVER-49979</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.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_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        46 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_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>
                            46 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>jennifer.peshansky@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i20r8n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1j4k0:</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_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|i20ddz:</customfieldvalue>

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