From: Mike Taylor Date: Thu, 26 Oct 2006 17:17:27 +0000 (+0000) Subject: When actually obtaining the record with $rs->record(), specify the X-Git-Tag: CPAN-v1.02~54^2~848 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=958430ce05b1d7aee3f26de1ef198e6fb343dad8;ds=sidebyside When actually obtaining the record with $rs->record(), specify the same syntax that specified when the record was requested with $rs->records($index0, 1, 0). This avoids a silly bug where, having asynchronously fetched the record in the required syntax, we then ignored that and synchronously fetched it in the prevailing syntax. D'oh! --- diff --git a/lib/ZOOM/IRSpy/Test/Record/Fetch.pm b/lib/ZOOM/IRSpy/Test/Record/Fetch.pm index a4275c5..f79d6ba 100644 --- a/lib/ZOOM/IRSpy/Test/Record/Fetch.pm +++ b/lib/ZOOM/IRSpy/Test/Record/Fetch.pm @@ -1,4 +1,4 @@ -# $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 @@ -73,7 +73,8 @@ sub record { 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', @@ -84,6 +85,18 @@ sub record { } +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'};