Subject: | Count() returns incorrect value after a new Limit() |
In Count() ...
# If we haven't actually got all objects loaded in memory, we
# really just want to do a quick count from the database.
if ( $self->{'must_redo_search'} ) {
# If we haven't already asked the database for the row count, do that
$self->_DoCount unless ( $self->{'raw_rows'} );
#Report back the raw # of rows in the database
return ( $self->{'raw_rows'} );
}
** Problem:
$self->{'must_redo_search'} is true, but the new search is not done when a count is requested! Thats because the old value is still in $self->{'raw_rows'}.
** Work around:
Call _DoCount() manually which forces it to redo the search and update the row count properly.
** Fix:
um, dunno, maybe just do a _DoCount() if $self->{'must_redo_search'} is true, even if $self->{'raw_rows'} is set. (take away the: unless ...)