Subject: | Paged Resultsets unable to return rows due to LIMIT/OFFSET ranges |
1) Paging a resultset adds offset/limit to the (to be) generated SQL.
2) $self in a resultset refers to the resultset.
3) $self->find($an_id_in_the_resultset); in the resultset triggers the SQL generation
SQL on pages 2 and above, will be as follows (page 1 omits the offset causing the bug not to manifest) :
SELECT me.id FROM stuff me WHERE ( me.id = ? ) LIMIT ? OFFSET ?: '5', '4', '4'
The specific issue is that the SQL server will apply the where clause BEFORE the limit/offset, this causes the SQL to return no results despite the id in question being in the original resultset.
Have attached a test case illustrating the issue.
Subject: | Test.zip |
Message body not shown because it is not plain text.