Project

General

Profile

« Previous | Next » 

Revision 3786

Added by Jing Tao over 16 years ago

Fixed a bug pathexpr was modified if pathexpr is an attribute.

View differences:

src/edu/ucsb/nceas/metacat/QueryTerm.java
226 226
                usePathIndex = true;
227 227
            }
228 228
        }
229

  
229
        
230
        
230 231
        if(usePathIndex){
231 232
            // using xml_path_index table.....
232 233
        	if(notEqual == true ){
......
270 271
        	self.append(searchexpr);
271 272
        	
272 273
            if (pathexpr != null) {
273

  
274
             String path = pathexpr;
274 275
                // use XML Index
275 276
                if (useXMLIndex) {
276 277
                    if (!hasAttributeInPath(pathexpr)) {
......
293 294
                                                  QuerySpecification.ATTRIBUTESYMBOL))) {
294 295

  
295 296
                            self.append("AND parentnodeid IN ");
296
                            pathexpr = QuerySpecification
297
                            path = QuerySpecification
297 298
                                .newPathExpressionWithOutAttribute(pathexpr);
298 299
                        }
299 300
                    }
300 301
                    self.append(
301 302
                        "(SELECT nodeid FROM xml_index WHERE path LIKE "
302
                        + "'" + pathexpr + "') ");
303
                        + "'" + path + "') ");
303 304
                }
304 305
                else {
305 306
                    // without using XML Index; using nested statements instead

Also available in: Unified diff