<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:03: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>[SERVER-3470] multiline commands are not saved completly in history</title>
                <link>https://jira.mongodb.org/browse/SERVER-3470</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;While entering multi-line command, mongodb shell persist  only first line of the command in history. It should persist multiple line of the command as a whole like MySql does.&lt;/p&gt;

&lt;p&gt;For example: when i type as below:&lt;br/&gt;
&amp;gt; db.help(&lt;br/&gt;
  ... )&lt;br/&gt;
&amp;gt;&lt;br/&gt;
Only &quot;db.help(&quot; string saved in history and next time when i access history will get only &quot;db.help(&quot;.&lt;/p&gt;

&lt;p&gt;Ideally it should save the whole command and next time when i check history it should bring back the command as a whole. &lt;/p&gt;

&lt;p&gt;Fix:&lt;br/&gt;
---------&lt;br/&gt;
File: shell/dbshell.cpp&lt;/p&gt;

&lt;p&gt;Changing this line will start storing the whole command in history. But not sure from where the command is read again so that piece also need to take care of this scenario. &lt;/p&gt;

&lt;p&gt;line:788 shellHistoryAdd( line );    ==&amp;gt;  shellHistoryAdd(code.c_str() );&lt;/p&gt;</description>
                <environment>Ubuntu 11.04 i386</environment>
        <key id="20059">SERVER-3470</key>
            <summary>multiline commands are not saved completly in history</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="swapnil">Swapnil Tailor</reporter>
                        <labels>
                            <label>commands</label>
                            <label>history</label>
                            <label>rn</label>
                    </labels>
                <created>Sat, 23 Jul 2011 20:27:02 +0000</created>
                <updated>Tue, 12 Jul 2016 00:17:01 +0000</updated>
                            <resolved>Fri, 18 Nov 2011 18:37:16 +0000</resolved>
                                    <version>1.9.1</version>
                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="67646" author="tad" created="Fri, 18 Nov 2011 18:37:16 +0000"  >&lt;p&gt;Fixed in commit 05717037fb8cf7b8bf9f7e935d23e64f74a70311.&lt;/p&gt;</comment>
                            <comment id="67644" author="auto" created="Fri, 18 Nov 2011 18:27:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;&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-3470&quot; title=&quot;multiline commands are not saved completly in history&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3470&quot;&gt;&lt;del&gt;SERVER-3470&lt;/del&gt;&lt;/a&gt; &amp;#8211; store multi-line commands in history&lt;/p&gt;

&lt;p&gt;Convert newlines to spaces and store the entire multi-line command instead&lt;br/&gt;
of just the line that began the command.  Fix initial cap in error message.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/05717037fb8cf7b8bf9f7e935d23e64f74a70311&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/05717037fb8cf7b8bf9f7e935d23e64f74a70311&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="60636" author="eliot" created="Sat, 15 Oct 2011 05:29:26 +0000"  >&lt;p&gt;I&apos;m not sure that&apos;s exactly the behavior we want.&lt;br/&gt;
If memory servers - most systems that do this would have each line be a separate history entry.&lt;br/&gt;
So the fix would need to be a little different.&lt;/p&gt;

&lt;p&gt;I can see the value in this, just not sure which people expect.&lt;/p&gt;</comment>
                            <comment id="60175" author="tad" created="Thu, 13 Oct 2011 02:45:09 +0000"  >&lt;p&gt;One more time ... I closed pull request 118 and opened &lt;a href=&quot;https://github.com/mongodb/mongo/pull/119&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/119&lt;/a&gt; to replace it.&lt;br/&gt;
I changed my mind and reverted an unrelated change I had included (in both previous versions of the pull request) and rather than have a change and a reversion in the same pull request, I just replaced the pull request.&lt;/p&gt;</comment>
                            <comment id="60170" author="tad" created="Thu, 13 Oct 2011 01:49:58 +0000"  >&lt;p&gt;I closed pull request 102 and opened &lt;a href=&quot;https://github.com/mongodb/mongo/pull/118&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/118&lt;/a&gt; to replace it.&lt;br/&gt;
Same code, but without the unrelated commits.&lt;/p&gt;</comment>
                            <comment id="59409" author="eliot" created="Mon, 10 Oct 2011 05:02:41 +0000"  >&lt;p&gt;need to read pull 102 more&lt;/p&gt;</comment>
                            <comment id="59140" author="tad" created="Fri, 7 Oct 2011 16:56:48 +0000"  >&lt;p&gt;Hi Swapnil,&lt;/p&gt;

&lt;p&gt;An additional comment on the error you were hitting ...  I&apos;m not sure why the error that is showing up in your earlier comment is &quot;unterminated string literal&quot; and this seems like an odd message when you didn&apos;t include a string literal.  But the &quot;big picture&quot; nature of the error is that when you enter a multiline command, there is code that runs that works on what you typed and prepares it for passing to the JavaScript interpreter.  When a command line is recalled, none of this code runs, and your text is passed directly to the command line handler which (in this case) passes it off to the JavaScript interpreter without the extra processing.  The newline in the text that is passed is somehow being interpreted such that the &quot;unterminated string literal&quot; error is what it hits, and this kind of thing could change as we transition from one JavaScript engine to another.  It could also be an artifact of our internal processing of your input (suggested by the &quot;(shellhelp1):1&quot; portion of the error message).  But the &quot;bottom line&quot; is that passing newlines directly to this code doesn&apos;t work, and converting the newlines to spaces does work except for the automatic semicolon insertion issue I mentioned above.&lt;/p&gt;

&lt;p&gt;Since your fix works (with the newline change) and is a real improvement, I suspect that you&apos;ll see it in a future release.&lt;/p&gt;

&lt;p&gt;Thanks for the thanks.  Bug reports are at their best when we&apos;re provided the code changes.  Thanks for your support!&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;</comment>
                            <comment id="59117" author="swapnil" created="Fri, 7 Oct 2011 15:56:22 +0000"  >&lt;p&gt;Thanks Tad for including the changes into your pull request.&lt;/p&gt;</comment>
                            <comment id="59074" author="tad" created="Fri, 7 Oct 2011 13:52:24 +0000"  >&lt;p&gt;One additional thing to note is that the recalled command may need to have semicolons inserted into it to work right when you hit return to enter it.  JavaScript has a concept of &quot;automatic semicolon insertion&quot;: see section 7.9 in the ECMAScript standard (an online copy is at &lt;a href=&quot;http://bclary.com/2004/11/07/#a-7.9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bclary.com/2004/11/07/#a-7.9&lt;/a&gt; ).  Because of this, converting newlines to spaces can break legal JavaScript if the code was relying on this feature.  This isn&apos;t a big deal because you can either include semicolons at the end of lines where JavaScript would insert them automatically, or you can add them with command line editing before you hit return.&lt;/p&gt;</comment>
                            <comment id="59070" author="tad" created="Fri, 7 Oct 2011 13:24:49 +0000"  >&lt;p&gt;Hi Swapnil,&lt;/p&gt;

&lt;p&gt;The reason you are getting this error is that code.c_str() includes all the newline characters from your multiline command.  I issued my own pull request to get your fix in with the addition of converting newlines to spaces.  It works great, thanks for suggesting this and showing us the fix!  Your db.help example works now and history brings back db.help( ) which is the full command with the newline converted to a space.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;https://github.com/mongodb/mongo/pull/102&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/102&lt;/a&gt; for the code changes.&lt;/p&gt;

&lt;p&gt;Tad&lt;/p&gt;
</comment>
                            <comment id="44625" author="swapnil" created="Tue, 26 Jul 2011 20:53:33 +0000"  >&lt;p&gt;Hi Eliot,&lt;/p&gt;

&lt;p&gt;Made the changes for the same.&lt;br/&gt;
Could you please assign someone who can review it?&lt;br/&gt;
Here is the pull request: &lt;a href=&quot;https://github.com/mongodb/mongo/pull/69&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/69&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="44204" author="swapnil" created="Sun, 24 Jul 2011 13:05:21 +0000"  >&lt;p&gt;after making above suggested changes, i am facing  below error when i immediately execute the same command after taking it from history.&lt;br/&gt;
&amp;gt;db.help(&lt;br/&gt;
  )&lt;br/&gt;
-&amp;gt; correct result returned here.&lt;br/&gt;
-&amp;gt; pressing up arrow key to fetch history&lt;br/&gt;
&amp;gt; db.help(&lt;br/&gt;
          )&lt;br/&gt;
Sun Jul 24 18:15:19 SyntaxError: unterminated string literal (shellhelp1):1&lt;br/&gt;
error2:(shellhelp1) exec failed: SyntaxError: unterminated string literal (shellhelp1):1db.help(&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;Not sure why sytnax error is coming while executing the same command after fetching it from history and executing it. &lt;/p&gt;

&lt;p&gt;Any idea? In both the case i checked the ascii characters and they were both same as below:&lt;br/&gt;
100 98 46 104 101 108 112 40 10 41&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 7 Oct 2011 13:24:49 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 13 weeks, 5 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>swapnil</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|hrovav:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9295</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_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|ht0s8f:</customfieldvalue>

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