<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Thu May 23 20:52:12 CDT 2013

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 add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/JCBC-241/JCBC-241.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[JCBC-241] Paginator object doesn&apos;t move onto next &quot;page&quot; correctly</title>
                <link>http://www.couchbase.com/issues/browse/JCBC-241</link>
                <project id="10080" key="JCBC">Couchbase Java Client</project>
                        <description>Customer found his own issue:&lt;br/&gt;
I had a look at the source code for the java driver and found the error there. It is in:&lt;br/&gt;
&lt;br/&gt;
com.couchbase.client.protocol.views.Paginator.getNextPage()&lt;br/&gt;
&lt;br/&gt;
Right after calculating the number of &amp;quot;remaining&amp;quot; keys, it sets the limit of the query to the remaining number of keys and re-runs the query. What is missing here is:&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;q.setSkip(totalDocs);&lt;br/&gt;
&lt;br/&gt;
To actually start from the entry after the last entry on the current page. I have tried this and it works. But there is more code in this method and it is not very easy to follow so important to make sure that this fits.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
I am enclosing a diff.</description>
                <environment></environment>
            <key id="22581">JCBC-241</key>
            <summary>Paginator object doesn&apos;t move onto next &quot;page&quot; correctly</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10011">Public</security>
                        <assignee username="daschl">Michael Nitschinger</assignee>
                                <reporter username="perry">Perry Krug</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Feb 2013 04:02:32 -0600</created>
                <updated>Wed, 8 May 2013 05:25:14 -0500</updated>
                    <resolved>Wed, 8 May 2013 05:25:14 -0500</resolved>
                            <version>1.1.2</version>
                                <fixVersion>1.1.6</fixVersion>
                                <component>library</component>
                                <votes>0</votes>
                        <watches>1</watches>
                                                    <comments>
                    <comment id="49958" author="perry" created="Thu, 7 Feb 2013 11:47:55 -0600"  >Update, but the bug still stands as described.&lt;br/&gt;
&lt;br/&gt;
It seems that my fix is not the correct one. The bug seem to be that although the Paginator specifies setStartkeyDocID, the query doesn&amp;#39;t start from this key.&lt;br/&gt;
&lt;br/&gt;
I have debugged the Paginator class &#8211; and when resolving the next page it instructs the query to start from a specific doc id, e.g:&lt;br/&gt;
&lt;br/&gt;
Query: ?limit=50&amp;amp;startkey=144&amp;amp;skip=0&amp;amp;stale=false&amp;amp;startkey_docid=144&lt;br/&gt;
&lt;br/&gt;
But as a result of this query I get:&lt;br/&gt;
&lt;br/&gt;
Got key: 1&lt;br/&gt;
Got key: 10&lt;br/&gt;
Got key: 100&lt;br/&gt;
Got key: 101&lt;br/&gt;
Got key: 102&lt;br/&gt;
Got key: 103&lt;br/&gt;
&#8230;&lt;br/&gt;
Got key: 141&lt;br/&gt;
Got key: 142&lt;br/&gt;
Got key: 143&lt;br/&gt;
&lt;br/&gt;
Every time. So the bug is in the Query context somewhere.&lt;br/&gt;
&lt;br/&gt;
Also &#8211; a note of inefficiency in the Paginator class: why perform two queries every time? One for the content of the &amp;quot;page&amp;quot; and one to find the row for the next page? Would be better to query for page + 1 and keep the last separate from the ViewResponse.&lt;br/&gt;
&lt;br/&gt;
So, what I can conclude is that when the Paginator bug is resolved it should work fine for us. The additional query for the last row could be an issue though, since it uses setSkip(). So could this be treated as a bug as well?&lt;br/&gt;
</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Dependency</name>
                                <outwardlinks description="depends on">
                                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="16713" name="paginator-java.diff" size="36" author="perry" created="Thu, 7 Feb 2013 04:02:32 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>25</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                <customfield id="customfield_10080" key="com.pyxis.greenhopper.jira:gh-sprint">
                <customfieldname>Sprint</customfieldname>
                <customfieldvalues>
                        <customfieldvalue>13</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                </customfields>
    </item>
</channel>
</rss>