Project

General

Profile

« Previous | Next » 

Revision 7408

handle case where we do not have a pathexpr to check
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5696

View differences:

src/edu/ucsb/nceas/metacat/DBQuery.java
662 662
              query = qspec.printSQL(useXMLIndex, docidValues);
663 663
              parameterValues.addAll(docidValues);
664 664
              String myOperator = "";
665
              if (!query.endsWith("WHERE")) {
665
              if (!query.endsWith("WHERE") && !query.endsWith("OR") && !query.endsWith("AND")) {
666 666
	              if (operator.equalsIgnoreCase(QueryGroup.UNION)) {
667 667
	            	  myOperator =  " OR ";
668 668
	              }
......
689 689
        qspec.setGroup(groups);
690 690
        // Get access query
691 691
        String accessQuery = qspec.getAccessQuery();
692
        if(!query.endsWith("WHERE")){
692
        if(!query.endsWith("AND")){
693 693
            query = query + accessQuery;
694 694
        } else {
695 695
            query = query + accessQuery.substring(4, accessQuery.length());

Also available in: Unified diff