<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:37 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-2325] Distinct fails at compound indexes for the second index</title>
                <link>https://jira.mongodb.org/browse/SERVER-2325</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When using compound index and distinct on the second part of the compound index, the distinct command fails.&lt;/p&gt;

&lt;p&gt;Example (Testdata):&lt;/p&gt;

&lt;p&gt;consus.tag document:&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;4d231bf4e175535eb49cef31&quot;),&lt;br/&gt;
	&quot;shopCode&quot; : &quot;BD_DE&quot;,&lt;br/&gt;
	&quot;value&quot; : &quot;TKUODAIFVTYPWHCM&quot;,&lt;br/&gt;
	&quot;mprgs&quot; : [&lt;br/&gt;
		&quot;mprg12&quot;,&lt;br/&gt;
		&quot;mprg19&quot;&lt;br/&gt;
	],&lt;br/&gt;
	&quot;mprgsWithPromotion&quot; : [&lt;br/&gt;
		&quot;mprg12&quot;&lt;br/&gt;
	],&lt;br/&gt;
	&quot;prgs&quot; : [&lt;br/&gt;
		&quot;prg4&quot;,&lt;br/&gt;
		&quot;prg3&quot;&lt;br/&gt;
	],&lt;br/&gt;
	&quot;prgsWithPromotion&quot; : []&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Indexed:&lt;/p&gt;

&lt;p&gt;use consus&lt;br/&gt;
db.tag.ensureIndex(&lt;/p&gt;
{shopCode: 1, value: 1}
&lt;p&gt;)&lt;br/&gt;
db.tag.ensureIndex(&lt;/p&gt;
{mprgs: 1}
&lt;p&gt;)&lt;br/&gt;
db.tag.ensureIndex(&lt;/p&gt;
{prgs: 1}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;Query:&lt;/p&gt;

&lt;p&gt;db.tag.distinct(&apos;value&apos;, &lt;/p&gt;
{shopCode: &apos;BD_DE&apos;}
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;Tue Jan  4 15:26:14 uncaught exception: distinct failed: {&lt;br/&gt;
	&quot;errmsg&quot; : &quot;exception: assertion db/clientcursor.cpp:307&quot;,&lt;br/&gt;
	&quot;code&quot; : 0,&lt;br/&gt;
	&quot;ok&quot; : 0&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Console:&lt;/p&gt;

&lt;p&gt;Tue Jan  4 15:16:40 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn76&amp;#93;&lt;/span&gt;  consus Assertion failure x == 0 db/clientcursor.cpp 307&lt;br/&gt;
0x1000755f2 0x10008493e 0x1001c4a8d 0x10035b9cc 0x10033c931 0x10033db43 0x10016dca4 0x10017266c 0x1002a9e98 0x1002b52af 0x100417bd5 0x10042d0e4 0x7fff8695d456 0x7fff8695d309 &lt;br/&gt;
 0   mongod                              0x00000001000755f2 _ZN5mongo12sayDbContextEPKc + 178&lt;br/&gt;
 1   mongod                              0x000000010008493e _ZN5mongo8assertedEPKcS1_j + 286&lt;br/&gt;
 2   mongod                              0x00000001001c4a8d _ZN5mongo12ClientCursor15getFieldsDottedERKSsRSt3setINS_11BSONElementENS_26BSONElementCmpWithoutFieldESaIS4_EE + 413&lt;br/&gt;
 3   mongod                              0x000000010035b9cc _ZN5mongo15DistinctCommand3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb + 1516&lt;br/&gt;
 4   mongod                              0x000000010033c931 _ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 1425&lt;br/&gt;
 5   mongod                              0x000000010033db43 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi + 1699&lt;br/&gt;
 6   mongod                              0x000000010016dca4 _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi + 52&lt;br/&gt;
 7   mongod                              0x000000010017266c &lt;em&gt;ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1&lt;/em&gt; + 9852&lt;br/&gt;
 8   mongod                              0x00000001002a9e98 _ZN5mongo13receivedQueryERNS_6ClientERNS_10DbResponseERNS_7MessageE + 568&lt;br/&gt;
 9   mongod                              0x00000001002b52af _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE + 5055&lt;br/&gt;
 10  mongod                              0x0000000100417bd5 _ZN5mongo10connThreadEPNS_13MessagingPortE + 421&lt;br/&gt;
 11  mongod                              0x000000010042d0e4 thread_proxy + 132&lt;br/&gt;
 12  libSystem.B.dylib                   0x00007fff8695d456 _pthread_start + 331&lt;br/&gt;
 13  libSystem.B.dylib                   0x00007fff8695d309 thread_start + 13  &lt;/p&gt;

&lt;p&gt;stats():&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
	&quot;ns&quot; : &quot;consus.tag&quot;,&lt;br/&gt;
	&quot;count&quot; : 302,&lt;br/&gt;
	&quot;size&quot; : 158412,&lt;br/&gt;
	&quot;avgObjSize&quot; : 524.5430463576159,&lt;br/&gt;
	&quot;storageSize&quot; : 179712,&lt;br/&gt;
	&quot;numExtents&quot; : 3,&lt;br/&gt;
	&quot;nindexes&quot; : 4,&lt;br/&gt;
	&quot;lastExtentSize&quot; : 137216,&lt;br/&gt;
	&quot;paddingFactor&quot; : 1,&lt;br/&gt;
	&quot;flags&quot; : 1,&lt;br/&gt;
	&quot;totalIndexSize&quot; : 352256,&lt;br/&gt;
	&quot;indexSizes&quot; : &lt;/p&gt;
{
		&quot;_id_&quot; : 24576,
		&quot;shopCode_1_value_1&quot; : 32768,
		&quot;mprgs_1&quot; : 147456,
		&quot;prgs_1&quot; : 147456
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>MacOsX 10.6.4, MongoDB 64Bit 1.7.4, Java Driver 2.4</environment>
        <key id="14146">SERVER-2325</key>
            <summary>Distinct fails at compound indexes for the second index</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="gerhardb">Gerhard Balthasar</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Jan 2011 14:32:59 +0000</created>
                <updated>Tue, 12 Jul 2016 00:19:55 +0000</updated>
                            <resolved>Wed, 5 Jan 2011 05:32:08 +0000</resolved>
                                    <version>1.7.4</version>
                                    <fixVersion>1.7.5</fixVersion>
                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="22069" author="auto" created="Wed, 5 Jan 2011 05:32:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;erh&apos;, u&apos;name&apos;: u&apos;Eliot Horowitz&apos;, u&apos;email&apos;: u&apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: fix ClientCursor::getFieldsDotted with compound keys &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2325&quot; title=&quot;Distinct fails at compound indexes for the second index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2325&quot;&gt;&lt;del&gt;SERVER-2325&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4b80354d2fdf18d187673631cee3755000784be8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4b80354d2fdf18d187673631cee3755000784be8&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 5 Jan 2011 05:32:41 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 7 weeks 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>
                            13 years, 7 weeks 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_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10021"><![CDATA[OS X]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>gerhardb</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp8yn:</customfieldvalue>

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

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

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