projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LIMIT doesn't work since we don't get correct number of results
[BackupPC.git]
/
lib
/
BackupPC
/
Search.pm
diff --git
a/lib/BackupPC/Search.pm
b/lib/BackupPC/Search.pm
index
38837c0
..
ee982ff
100644
(file)
--- a/
lib/BackupPC/Search.pm
+++ b/
lib/BackupPC/Search.pm
@@
-227,24
+227,25
@@
sub getFiles($) {
my $order = getSort('search', 'sql', $param->{'sort'});
my $order = getSort('search', 'sql', $param->{'sort'});
+ # XXX LIMIT $on_page doesn't work since we don't get correct number of results
my $sql_order = qq{
ORDER BY $order
my $sql_order = qq{
ORDER BY $order
- LIMIT $on_page
OFFSET ?
};
my $sql_results = qq{ select $sql_cols $sql_from $sql_where $sql_order };
my $sth = $dbh->prepare($sql_results);
OFFSET ?
};
my $sql_results = qq{ select $sql_cols $sql_from $sql_where $sql_order };
my $sth = $dbh->prepare($sql_results);
- $sth->execute( $offset );
+
my $rows =
$sth->execute( $offset );
my @ret;
my @ret;
-
+
while (my $row = $sth->fetchrow_hashref()) {
push @ret, $row;
while (my $row = $sth->fetchrow_hashref()) {
push @ret, $row;
+ last if $#ret + 1 >= $on_page;
}
$sth->finish();
}
$sth->finish();
- return ($
sth->
rows, \@ret);
+ return ($rows, \@ret);
}
sub getFilesHyperEstraier($) {
}
sub getFilesHyperEstraier($) {