Review Request 125544: Fix limit/offset handling when sort option is no sort.

Boudhayan Gupta bgupta at kde.org
Fri Oct 9 20:36:11 UTC 2015



> On Oct. 10, 2015, 12:58 a.m., Boudhayan Gupta wrote:
> > src/lib/searchstore.cpp, line 126
> > <https://git.reviewboard.kde.org/r/125544/diff/2/?file=410375#file410375line126>
> >
> >     Shouldn't this be qMin(size, offset + limit)?
> 
> Vishesh Handa wrote:
>     I don't think it matters.
>     
>     If there aren't any more elements then `it->next()` will be false.

Ah, right. Silly me.

I'm dropping the issue.


- Boudhayan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125544/#review86568
-----------------------------------------------------------


On Oct. 10, 2015, 12:27 a.m., Xuetian Weng wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125544/
> -----------------------------------------------------------
> 
> (Updated Oct. 10, 2015, 12:27 a.m.)
> 
> 
> Review request for Baloo, Release Team and Vishesh Handa.
> 
> 
> Repository: baloo
> 
> 
> Description
> -------
> 
> The bug is obvious, old code uses limit instead of (limit > 0), which gracefully handles limit < 0 case (means everything).
> 
> After offset is introduced, limit < 0 case is not handled properly.
> 
> This patch contains following changes:
> 1. make offset uint, m_offset is uint in Query already.
> 2. handle limit < 0 case properly.
> 
> Also fix offset with sorting.
> 
> 
> Diffs
> -----
> 
>   src/lib/searchstore.h 17b4263 
>   src/lib/searchstore.cpp a2e7749 
> 
> Diff: https://git.reviewboard.kde.org/r/125544/diff/
> 
> 
> Testing
> -------
> 
> baloosearch:/ doesn't return anything because of this, now it properly returns result.
> 
> Play with baloosearch command a little bit, offset and limit returns the [offset, offset + limit) and no crash on the border case.
> 
> 
> Thanks,
> 
> Xuetian Weng
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/release-team/attachments/20151009/a7a7d901/attachment.html>


More information about the release-team mailing list