Project

General

Profile

« Previous | Next » 

Revision 7407

simplify the xml_access query, and instead use guid to check for permission. Now the docid/rev join (to get most recent version for search results) happens "higher up" in the query.
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5696

View differences:

DBQuery.java
640 640
    	  // condition for the docids
641 641
    	  List<Object> docidConditionValues = new ArrayList<Object>();
642 642
    	  StringBuffer docidCondition = new StringBuffer();
643
    	  docidCondition.append( " docid IN (" );
643
    	  docidCondition.append( " xml_documents.docid IN (" );
644 644
          for (int i = 0; i < givenDocids.size(); i++) {  
645 645
        	  docidCondition.append("?");
646 646
        	  if (i < givenDocids.size()-1) {
......
652 652
		  
653 653
    	  // include the docids, either exclusively, or in conjuction with the query
654 654
    	  if (operator == null) {
655
    		  query = "SELECT docid, docname, doctype, date_created, date_updated, rev FROM xml_documents WHERE";
655
    		  query = "SELECT xml_documents.docid, docname, doctype, date_created, date_updated, xml_documents.rev " +
656
    		  		"FROM xml_documents, identifier " +
657
    		  		"WHERE xml_documents.docid = identifier.docid AND xml_documents.rev = identifier.rev AND ";
656 658
              query = query + docidCondition.toString();
657 659
              parameterValues.addAll(docidConditionValues);
658 660
    	  } else {

Also available in: Unified diff