Project

General

Profile

« Previous | Next » 

Revision 2487

Added by sgarg about 16 years ago

Fixed a bug in last commit. Doing a search like
pathquery version="1.2">
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype><returnfield>originator/individualName/surName</returnfield><querygroup operator="INTERSECT"><queryterm casesensitive="false" searchmode="contains"><value>%</value></queryterm><queryterm casesensitive="false" searchmode="contains"><value>National Center for Ecological Analysis and Synthesis</value><pathexpr>organizationName</pathexpr></queryterm></querygroup></pathquery>

resulted in a query like this: SELECT docid,docname,doctype,date_created, date_updated, rev FROM xml_documents WHERE docid IN ((SELECT DISTINCT docid FROM xml_nodes WHERE UPPER LIKE '%ORGANIZATION OF BIOLOGICAL FIELD STATIONS%' AND parentnodeid IN )) AND (docid IN ='public') OR (docid IN (SELECT docid from xml_access WHERE = 'public' AND perm_type = 'allow' AND (permission='4' OR permission='7'))OR (lower(principal_name) = 'public' AND perm_type = 'allow' AND (permission='4' OR permission='7'))) AND subtreeid IS NULL) AND docid NOT IN (SELECT docid from xml_access WHERE = 'public' AND perm_type = 'deny' AND perm_order ='allowFirst' AND (permission='4' OR permission='7'))OR (lower(principal_name) = 'public' AND perm_type = 'deny' AND perm_order ='allowFirst' AND (permission='4' OR permission='7'))) AND subtreeid IS NULL )))

where the error is that nothing is being inserted after "AND parentnodeid IN"

Fixed the last commit so that correct query is executed:

SELECT docid,docname,doctype,date_created, date_updated, rev FROM xml_documents WHERE docid IN ((SELECT DISTINCT docid FROM xml_nodes WHERE UPPER(nodedata) LIKE '%NATIONAL CENTER FOR ECOLOGICAL ANALYSIS AND SYNTHESIS%' AND parentnodeid IN (SELECT nodeid FROM xml_index WHERE path LIKE 'organizationName') ))  AND (docid IN(SELECT docid FROM xml_documents WHERE lower(user_owner) ='public') OR (docid IN (SELECT docid from xml_access WHERE( (lower(principal_name) = 'public' AND perm_type = 'allow' AND (permission='4' OR permission='7'))OR (lower(principal_name) = 'public' AND perm_type = 'allow' AND (permission='4' OR permission='7'))) AND subtreeid IS NULL) AND docid NOT IN (SELECT docid from xml_access WHERE( (lower(principal_name) = 'public' AND perm_type = 'deny' AND perm_order ='allowFirst' AND (permission='4' OR permission='7'))OR (lower(principal_name) = 'public' AND perm_type = 'deny' AND perm_order ='allowFirst' AND (permission='4' OR permission='7'))) AND subtreeid IS NULL )))

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences