Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11764

Modified Files:
      Tag: XQuery_0-18
        pathfinder.mx 
Log Message:
fixs regarding the streettivo/tijah/buggy.xq problem
- main fix is in fn:open, its head void column may have been nil, iso dense
- fix in pf:collection, such that collections are not opened twice
- fix in ws_lookup; if a qn is not indexed (valid =false) an error would be 
raised



Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.367.2.4
retrieving revision 1.367.2.5
diff -u -d -r1.367.2.4 -r1.367.2.5
--- pathfinder.mx       8 Jun 2007 00:38:19 -0000       1.367.2.4
+++ pathfinder.mx       9 Jun 2007 23:34:55 -0000       1.367.2.5
@@ -2243,11 +2243,11 @@
             del := reverse(ws.fetch(QN_NID_DEL).fetch(cont)).join(qn_ids);
         }
     }
-    if (valid and bit(count(ins) + count(del))) {
+    if (not(valid)) ERROR("index_lookup: qn_nid not indexed");
+    if (bit(count(ins) + count(del))) {
         # avoid doing this when ins/del are empty: res maybe a view on idx 
(readonly case)
         res := 
res.access(BAT_WRITE).insert(ins).deleteBuns(del).access(BAT_READ);
     }
-    if (not(valid)) ERROR("index_lookup: qn_nid not indexed");
 
     # SCJ must catch error and use sequential post-filter instead.
     return ws_docfilter(ws, sort(res).hmark(oid_nil), cont);
@@ -3093,26 +3093,28 @@
 }
 PROC ws_opendoc(BAT[void,BAT] ws, BAT[void,str] idx_names) : BAT[oid,oid] 
 {   
-    return ws_opendoc(ws,idx_names, bat(void,str).seqbase([EMAIL PROTECTED]),
-                                    bat(void,oid).seqbase([EMAIL PROTECTED]),
-                                    bat(void,oid).seqbase([EMAIL PROTECTED]), 
true); 
+    return ws_opendoc(ws,idx_names.seqbase([EMAIL PROTECTED]), 
bat(void,str).seqbase([EMAIL PROTECTED]),
+                                                 bat(void,oid).seqbase([EMAIL 
PROTECTED]),
+                                                 bat(void,oid).seqbase([EMAIL 
PROTECTED]), true); 
 }
 
 # pf:collection(), get 'collection root' as a single startpoint to query an 
entire collection
 PROC ws_collection_root(BAT[void,BAT] ws, BAT[void,str] colnames) : 
BAT[oid,oid]
 {
+    var colnames_unq := 
colnames.tdiff(ws.fetch(CONT_NAME)).tunique().mirror(); # [str,str]
     lock_set(pf_short);
-    var colname_coll, err := CATCH({ colname_coll := 
reverse(colnames).mirror().leftjoin(reverse(collection_name));
-                                     
colname_pins.insert(colname_coll.kunique().project(ws_id(ws))); });
+    var colnames_coll, err := CATCH({ colnames_coll := 
colnames_unq.leftjoin(reverse(collection_name));
+                                      
colname_pins.insert(colnames_coll.project(ws_id(ws))); });
     lock_unset(pf_short);
-    var notfound := colname_coll.kdiff(reverse(colnames));
+    var notfound := reverse(colnames_coll).tdiff(colnames);
     if (count(notfound) > 0) ERROR("pf:collection() %s not found (%d such 
errors).\n", notfound.fetch(0), count(notfound));
 
-    [EMAIL PROTECTED]() {
+    [EMAIL PROTECTED]() {
         var docBAT := [bat]([+](str(int($t)), ws_dsk).reverse().mirror()); # 
get master bats
         ws_opencoll(ws, docBAT, $h, $t); # collections are loaded one-by-one
     }
-    return 
reverse(colname_coll.leftjoin(reverse(ws.fetch(CONT_COLL)))).project([EMAIL 
PROTECTED]); # [CONT,PRE]
+    var ret := 
reverse(colnames.leftjoin(reverse(ws.fetch(CONT_NAME)))).project([EMAIL 
PROTECTED]); # [CONT,PRE]
+    return ret;
 }
 
 # fn:collection(), get document nodes of all documents in a collection


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to