[KinoSearch] Bug in binding of fetch_sim (Re: Fwd: CPAN Upload: S/SP/SPROUT/KSx-Highlight-Summarizer-0.05.tar.gz)

webmasters at ctosonline.org webmasters at ctosonline.org
Mon May 11 14:41:01 PDT 2009


On May 11, 2009, at 12:03 PM, Marvin Humphrey wrote:

> On Mon, May 11, 2009 at 09:56:37AM -0700, webmasters at ctosonline.org  
> wrote:
>>
>> On May 10, 2009, at 3:17 PM, Marvin Humphrey wrote:
>>
>>> BTW, I see the docs specify List::Util as a prerequisite.   
>>> However, KS
>>> requires Perl 5.8.3 as a minimum version, and List::Util became core
>>> in 5.7.3:
>>>
>>> ... so you can zap that.
>>
>> You’re not going to consider backporting it? :-)
>
> Nope.  :)
>
> Too many Perl Unicode bugs before 5.8.3.

I’ll delete it when I make the next release (whenever that will be),  
but I’ll leave it in Makefile.PL.

>
>> I have just found another binding bug. I encountered this with   
>> fetch_sim,
>> but it probably applies elsewhere, too.
>
> The fetch_sim bug was probably fixed by r4565.

I’m afraid not (I used 4573). There were two problems and you have  
fixed the lesser of the two. Here is the test again, for your  
convenience:

#!/usr/bin/perl -w

require KinoSearch::Schema;
require KinoSearch::FieldType::StringType;

my $schema = new KinoSearch::Schema;
$schema->spec_field(
  name => 'content',
  type => new KinoSearch::FieldType::StringType
);

sub t'TIEHASH { bless [] }
sub t'FETCH { 'content' }
tie %t, t;
warn $schema->fetch_sim('content');
warn $schema->fetch_sim($t{field});
__END__

Now I get an undef return value instead of the Schema:

KinoSearch::Search::Similarity=SCALAR(0x801a34) at t/test2 line 15.
Use of uninitialized value in warn at t/test2 line 16.
Warning: something's wrong at t/test2 line 16.

I tried changing ‘return sim’ to ‘return field’ (and changing the  
function to return a CharBuf*) and I got this:

content at t/test2 line 15.
Use of uninitialized value in warn at t/test2 line 16.
Warning: something's wrong at t/test2 line 16.

So the argument is not being passed properly.


Father Chrysostomos




More information about the kinosearch mailing list