From 6771d929066b9b15322ac8edb70b560545dbc65f Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 26 Oct 2006 17:17:27 +0000 Subject: [PATCH] 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! --- lib/ZOOM/IRSpy/Test/Record/Fetch.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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'}; -- 1.7.10.4