projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19338e4
)
Cannot fetch more than 1000 records at a time
author
pop
<pop>
Thu, 6 Mar 2003 23:32:10 +0000
(23:32 +0000)
committer
pop
<pop>
Thu, 6 Mar 2003 23:32:10 +0000
(23:32 +0000)
perl/lib/IDZebra/Resultset.pm
patch
|
blob
|
history
diff --git
a/perl/lib/IDZebra/Resultset.pm
b/perl/lib/IDZebra/Resultset.pm
index
80fabdb
..
7408d35
100644
(file)
--- a/
perl/lib/IDZebra/Resultset.pm
+++ b/
perl/lib/IDZebra/Resultset.pm
@@
-1,4
+1,4
@@
-# $Id: Resultset.pm,v 1.8 2003-03-05 13:55:22 pop Exp $
+# $Id: Resultset.pm,v 1.9 2003-03-06 23:32:10 pop Exp $
#
# Zebra perl API header
# =============================================================================
#
# Zebra perl API header
# =============================================================================
@@
-12,7
+12,7
@@
BEGIN {
use IDZebra::Logger qw(:flags :calls);
use Scalar::Util qw(weaken);
use Carp;
use IDZebra::Logger qw(:flags :calls);
use Scalar::Util qw(weaken);
use Carp;
- our $VERSION = do { my @r = (q$Revision: 1.8 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+ our $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our @ISA = qw(IDZebra::Logger);
}
our @ISA = qw(IDZebra::Logger);
}
@@
-91,6
+91,14
@@
sub records {
my $from = $args{from} ? $args{from} : 1;
my $to = $args{to} ? $args{to} : $self->{recordCount};
my $from = $args{from} ? $args{from} : 1;
my $to = $args{to} ? $args{to} : $self->{recordCount};
+ if (($to-$from) >= 1000) {
+ if ($args{to}) {
+ croak ("Cannot fetch more than 1000 records at a time");
+ } else {
+ $to = $from + 999;
+ }
+ }
+
my $elementSet = $args{elementSet} ? $args{elementSet} : 'R';
my $schema = $args{schema} ? $args{schema} : '';
my $recordSyntax = $args{recordSyntax} ? $args{recordSyntax} : '';
my $elementSet = $args{elementSet} ? $args{elementSet} : 'R';
my $schema = $args{schema} ? $args{schema} : '';
my $recordSyntax = $args{recordSyntax} ? $args{recordSyntax} : '';
@@
-109,7
+117,6
@@
sub records {
$to,
$ro);
$to,
$ro);
-
my @res = ();
for (my $i=$from; $i<=$to; $i++) {
my @res = ();
for (my $i=$from; $i<=$to; $i++) {
@@
-118,7
+125,7
@@
sub records {
if ($class) {
} else {
if ($class) {
} else {
- push (@res, $rec);
+ push (@res, $rec);
}
}
}
}