Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#176 closed defect (released)

Xapian::Query with OP_AND_NOT

Reported by: krzysztof klemm Owned by: Olly Betts
Priority: normal Milestone:
Component: Library API Version: 1.0.1
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: Linux

Description

hello,

I know that building query with empty and not empty objects type Xapian:Query using OP_AND_NOT doesn't have sense, but it works. If I want to show a query using method get_description() I got a SIGSEGV. I think that this situation should make a exception. I wrote a simple example of this situation below this text.

#include <xapian.h> #include <iostream>

using namespace std;

int main(int argc, char argv) {

Xapian::Query xquery;

try {

Xapian::Query xquery_term("test"); cout << "it works: " << xquery.get_description() << endl;

Xapian::Query xquery_1(Xapian::Query::OP_AND, xquery, xquery_term); cout << "it works: " << xquery_1.get_description() << endl;

Xapian::Query xquery_2(Xapian::Query::OP_AND_NOT, xquery, xquery_term); cout << "here is still ok" << endl; cout << "this it not work: " << xquery_2.get_description() << endl;

} catch (const Xapian::Error &e) {

cout << "Xapian exception" << endl;

} return 1;

}

Attachments (1)

query_nothing_and_not.patch (504 bytes ) - added by Olly Betts 17 years ago.
Patch to fix this bug

Download all attachments as: .zip

Change History (3)

by Olly Betts, 17 years ago

Attachment: query_nothing_and_not.patch added

Patch to fix this bug

comment:1 by Olly Betts, 17 years ago

Resolution: fixed
Status: newclosed

comment:2 by Richard Boulton, 17 years ago

Operating System: Linux
Resolution: fixedreleased

Fix is in upcoming 1.0.2 release. Marking as closed.

Note: See TracTickets for help on using tickets.