What version of DBD::SQLite? I've just started using SQLite, so I may
be missing something, but in DBD::SQLite v1.03,
sqlite_handle_binary_nulls is undocumented, and appears broken:
use strict;
use DBI;
use DBD::SQLite;
print "DBD::SQLite version: ", DBD::SQLite->VERSION, "\n";
my $dbh = DBI->connect('dbi:SQLite:dbname=testnull', '', '', {
RaiseError => 1,
PrintError => 0, AutoCommit => 1, sqlite_handle_binary_nulls => 1 });
$dbh->{sqlite_handle_binary_nulls} = 1; # Just in case
$dbh->do(qq(CREATE TABLE test (test_blob BLOB)));
my $string = "foo\0bar\0foo";
$dbh->do(qq(INSERT INTO test (test_blob) VALUES (?)), undef, $string);
my ($length, $return) = $dbh->selectrow_array(
qq(SELECT LENGTH(test_blob), test_blob FROM test));
print "Return value: $return\n";
print "Length: $length\n";
print "Length: $length\n";
__END__
$ ./test_case.pl
DBD::SQLite version: 1.03
Return value: foo
Length: 3
As you can see, the nulls in the string are not quoted properly.
In any case, I have quoted the nulls manually in my code for the
docweights table. The inverted tables that you mention should never
have a null character in the strings.
Do you have a test case where DBIx::TextIndex breaks?