Project

General

Profile

« Previous | Next » 

Revision 2078

Fixed a bug in the new recursive SQL statements that prevented them from operating on oracle. Now they should work on both oracle and postgres.

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
832 832
            for (int i = 0; i < returnFieldList.size(); i++) {
833 833
                if (firstfield) {
834 834
                    firstfield = false;
835
                    self.append("(");
836 835
                } else {
837
                    self.append(" UNION (");   
836
                    self.append(" UNION ");   
838 837
                }
839 838
                String path  = (String) returnFieldList.elementAt(i);
840 839
                self.append("select xml_nodes.docid, ");
......
850 849
                self.append(" AND xml_nodes.rootnodeid = xml_documents.rootnodeid");
851 850
                
852 851
                addAccessRestrictionSQL(unaccessableNodePair, self);
853
                self.append(")");
854 852
            }
855 853

  
856 854
            return self.toString();
......
959 957
                String attributeName = (String) currentVector.elementAt(1);
960 958
                if (firstfield) {
961 959
                    firstfield = false;
962
                    self.append("(");
963 960
                } else {
964
                    self.append(" UNION (");   
961
                    self.append(" UNION ");   
965 962
                }
966 963
                self.append("select xml_nodes.docid, '");
967 964
                self.append(returnPath);
......
974 971
                self.append("' AND xml_nodes.docid in (");
975 972
                self.append(doclist);
976 973
                self.append(") AND xml_nodes.nodetype = 'ATTRIBUTE'");
977
                self.append(" AND xml_nodes.rootnodeid = xml_documents.rootnodeid)");
974
                self.append(" AND xml_nodes.rootnodeid = xml_documents.rootnodeid");
978 975
            }
979 976
            
980 977
            MetaCatUtil.debugMessage("Attribute query: " + self.toString(), 30);

Also available in: Unified diff