Subject: | win32 core dump on fts4 tokenizer |
While working on CPAN module Lingua::Thesaurus, which uses SQLite, some of my tests generate core dumps. This happens when one program creates a database with a custom FTS4 tokenizer, and then another program reads that same database. Below are two excerpts to reproduce the problem, and some indications about the context.
- problem seen only on Windows 7; same programs on Solaris work fine
- using perl 5.14
- the program results are OK, which means that FTS4 tokenizer does its job
- apparently prog2 core dumps while performing DESTROY on the dbh. When bypassing the END section (through POSIX::_exit), everything is fine.
prog1.pl
========
use strict;
use warnings;
use DBI;
use Search::Tokenizer;
my $dbname = "foo.sqlite";
unlink $dbname;
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "","");
$dbh->do(<<"");
CREATE VIRTUAL TABLE term
USING fts4(content, tokenize=perl 'Search::Tokenizer::unaccent')
$dbh->do(<<"");
INSERT INTO term(content) values ('il était une bergère')
print "done";
prog2.pl
========
use strict;
use warnings;
use DBI;
use Search::Tokenizer;
my $dbname = "foo.sqlite";
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "","");
my $sql = "select * from term WHERE content MATCH 'bergere'";
my $sth = $dbh->prepare($sql);
$sth->execute;
my $res = $sth->fetchall_arrayref;
use YAML;
print Dump $res;
print "done";