-# $Id: Fetch.pm,v 1.8 2006-10-25 15:45:07 mike Exp $
+# $Id: Fetch.pm,v 1.9 2006-10-26 17:17:27 mike Exp $
# See the "Main" test package for documentation
if (1) {
print STDERR "Hits: ", $rs->size(), "\n";
print STDERR "Syntax: ", $syn, "\n";
- print STDERR $rs->record(0)->render();
+ my $record = _fetch_record($rs, 0, $syn);
+ print STDERR $record->render();
}
$conn->record()->store_result('record_fetch',
}
+sub _fetch_record {
+ my($rs, $index0, $syntax) = @_;
+
+ my $oldSyntax = $rs->option(preferredRecordSyntax => $syntax);
+ my $record = $rs->record(0);
+ $oldSyntax = "" if !defined $oldSyntax;
+ $rs->option(preferredRecordSyntax => $oldSyntax);
+
+ return $record;
+}
+
+
sub error {
my($conn, $task, $test_args, $exception) = @_;
my $syn = $test_args->{'syntax'};