From c4f880ae05250c9dc5cce6d2e865a6b04852de2d Mon Sep 17 00:00:00 2001 From: Yusuke Muraoka <yusuke@nexedi.com> Date: Mon, 1 Mar 2010 07:10:31 +0000 Subject: [PATCH] explained more about why raise the exception. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33157 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ZSQLCatalog/Query/ComplexQuery.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/product/ZSQLCatalog/Query/ComplexQuery.py b/product/ZSQLCatalog/Query/ComplexQuery.py index 07fb820ab6..b30a1e5c0e 100644 --- a/product/ZSQLCatalog/Query/ComplexQuery.py +++ b/product/ZSQLCatalog/Query/ComplexQuery.py @@ -119,8 +119,21 @@ class ComplexQuery(Query): def checkQueryTree(self): """ XXX - If self has 'or' operator and a RelatedQuery in the tree, - it will not return valid result. + The root of this query tree will not return semantic valid SQLExpression + when the self has 'or' operator and a RelatedQuery in the query tree of self. + The semantic valid means that, for example, there is a query tree which has + three queries: + - one is intended for searching document with the title 'bra%' + - one is intended for searching document which is related to a category + - a ComplexQuery with 'or' operator which has above queries as children + in this case, the root of the query tree should return an expression + "(document.tile like 'bra%') or (document related to the category and + the category entry must be in catalog)". This is semantic valid. + However at current implementation, return the expression + "(document.title like 'bra%' or document related to the category) and (the + category entry must be in catalog)". The outside relation between category + and catalog also affects the document.title condition. It is a limitation for + performance. We don't hope to return affected result. So raise the Exception. """ for query in self.query_list: result = self._findRelatedQuery(query) -- 2.30.9