[Bps-public-commit] dbix-searchbuilder branch, master, updated. 1.63_01-41-gd97c291

Thomas Sibley trs at bestpractical.com
Thu Apr 18 13:22:45 EDT 2013


The branch, master has been updated
       via  d97c2910fdb3dfc2452c8bb2c47d8160f272b80c (commit)
      from  837785c9746975226b3b1d8093a21472fecd2f9a (commit)

Summary of changes:
 lib/DBIx/SearchBuilder.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit d97c2910fdb3dfc2452c8bb2c47d8160f272b80c
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Apr 17 17:38:15 2013 -0700

    Reset the iterator position whenever a search is run
    
    The current iterator position, if set, will most likely have no bearing
    on the new search results and can cause falsely skipped items.  This
    type of bug can happen when another Limit is added after some items have
    been iterated already.

diff --git a/lib/DBIx/SearchBuilder.pm b/lib/DBIx/SearchBuilder.pm
index ef722a4..d72d1f4 100755
--- a/lib/DBIx/SearchBuilder.pm
+++ b/lib/DBIx/SearchBuilder.pm
@@ -232,8 +232,9 @@ sub _DoSearch {
 
     my $QueryString = $self->BuildSelectQuery();
 
-    # If we're about to redo the search, we need an empty set of items
+    # If we're about to redo the search, we need an empty set of items and a reset iterator
     delete $self->{'items'};
+    $self->{'itemscount'} = 0;
 
     my $records = $self->_Handle->SimpleQuery($QueryString);
     return 0 unless $records;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list