get_range_by_token + row_count

11 views
Skip to first unread message

William Oberman

unread,
Apr 7, 2014, 9:52:23 AM4/7/14
to phpc...@googlegroups.com
Is row_count ~= limit?  Looking at the implementation, that's what it seems like.

What I don't see is a way to remove the limit.  Given get_range_by_token returns an Iterator that pages through the results using buffer, having a row_count/limit doesn't seem required. 

It seems like passing in NULL is somewhat handled (line 79 does === to distinguish null vs 0 for example).  But, I think lines 119 and 189 need to be:
$this->row_count !== null && ($this->rows_seen > $this->row_count)
to prevent null => 0 => the test will always pass, terminating the iterator. 

Otherwise, the client is forced to pass in a randomly large int to get "all rows", which seems wonky to me.

will

Tyler Hobbs

unread,
Apr 9, 2014, 1:03:44 PM4/9/14
to phpc...@googlegroups.com
On Mon, Apr 7, 2014 at 8:52 AM, William Oberman <obe...@civicscience.com> wrote:
Is row_count ~= limit?  Looking at the implementation, that's what it seems like.

Yes
 

What I don't see is a way to remove the limit.  Given get_range_by_token returns an Iterator that pages through the results using buffer, having a row_count/limit doesn't seem required. 

It seems like passing in NULL is somewhat handled (line 79 does === to distinguish null vs 0 for example).  But, I think lines 119 and 189 need to be:
$this->row_count !== null && ($this->rows_seen > $this->row_count)
to prevent null => 0 => the test will always pass, terminating the iterator. 

Otherwise, the client is forced to pass in a randomly large int to get "all rows", which seems wonky to me.

I think you're correct.  null should remove the limit, but the lines you mention break that.  I'll get it patched up shortly.


--
Tyler Hobbs
DataStax
Reply all
Reply to author
Forward
0 new messages