#!/usr/bin/perl

use strict;
use warnings;

use Search::Xapian qw(:standard); # libsearch-xapian-perl 1.0.4.0-2 from Debian unstable

$|=1;

# These all work:
test_query('something other* this more');
test_query('other* this AND more');
test_query('something other this AND more');
test_query('something other* this more');

# This query throws a Xapian::QueryParserError and core dumps:
test_query('something other* this AND more');


sub test_query {
    my ($q)=@_;

    print "'$q' ";

    my $query_parser=Search::Xapian::QueryParser->new;

    $query_parser->parse_query($q, FLAG_BOOLEAN|FLAG_WILDCARD);

    print "[ok]\n";
}
