Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12230
Modified Files:
Tag: XQuery_0-18
pathfinder.mx shredder.mx
Log Message:
[ 1726599 ] XQuery: collection management broken
quite a variety of issues showed up:
- problem with incremental shredding (tdense and tsorted were not always reset)
surfaced in very small (1 node) documents
- del-doc now again always triggers a checkpoint (must do, for ACID)
- index maintenance for read-only forgot to dele the nsloc index
Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.367.2.3
retrieving revision 1.367.2.4
diff -u -d -r1.367.2.3 -r1.367.2.4
--- pathfinder.mx 6 Jun 2007 15:48:55 -0000 1.367.2.3
+++ pathfinder.mx 8 Jun 2007 00:38:19 -0000 1.367.2.4
@@ -2159,7 +2159,7 @@
# first shred (readonly) automatically creates persistent sorted index
var cnt := bat(str(lng(coll_oid)) + "_qn_histogram");
unq := reverse(ord_uselect([*](cnt,[log]([dbl](cnt))), dbl_nil,
dbl(count(knd))));
- } else if (maintain) {
+ } else {
# incremental readonly shred with existing indices: deactivate them
var coll_shortlock := reverse(runtime).fetch(RT_LOCK_FREELIST);
var coll_longlock := reverse(runtime).fetch(RT_NID_FREELIST);
@@ -2169,8 +2169,6 @@
commitbat := "old_" + commitbat;
CATCH({ bat(qn_nid).persists(false).rename(commitbat + "_qn_nid");
bat(vx_hsh_nid).persists(false).rename(commitbat +
"_vx_hsh_nid"); }); # delete idx in commit
- } else {
- commitbat := str_nil; # incremental readonly shred, but no index to
delete
}
if (int(unq) != int(empty_bat)) {
# compute a (partial) [qn,nid] inverted list, and insert in into the
index
@@ -3517,10 +3515,9 @@
[logger_add_bat](pf_logger, [bat](newcoll), newcoll);
lock_unset(pf_wal);
}
-
# checkpoint the new bats
if (pf_commit_docmgt)
- if (pf_checkpoint(commitBAT)) {
+ if (pf_checkpoint(commitBAT) or cleanup) {
# remove the in-memory undo log; and trim collection
lock_set(pf_short);
err := CATCH(commitBAT := _shred_doc_cleanup(wsid, cleanup));
@@ -3574,11 +3571,7 @@
count(reverse(del).uselect(oid_nil)));
}
del := kunique(del);
-
- # check if a document-id = its collection-id
- # this detects del-doc()s on single-doc collections
- var chk := mirror(del).leftjoin(doc_collection);
- ret := [=](chk.hmark([EMAIL PROTECTED]),chk.tmark([EMAIL
PROTECTED])).texist(true);
+ ret := true;
} else if (cachedOnly) {
del := del.uselect(timestamp_nil,timestamp_nil);
}
Index: shredder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/shredder.mx,v
retrieving revision 1.126.2.5
retrieving revision 1.126.2.6
diff -u -d -r1.126.2.5 -r1.126.2.6
--- shredder.mx 7 Jun 2007 07:50:13 -0000 1.126.2.5
+++ shredder.mx 8 Jun 2007 00:38:19 -0000 1.126.2.6
@@ -408,7 +408,10 @@
BAT *b = sb->bat;
b->batBuns->free = n*BUNsize(b);
BATsetcount(b, n);
- b->tsorted = 0;
+ if (b->ttype) {
+ b->tsorted = 0;
+ b->tdense = 0;
+ }
}
@@ -1770,9 +1773,13 @@
* whether it might still hold...)
*/
if (shredCtx->dstBAT[PRE_SIZE].bat->tkey == TRUE) {
+ shredCtx->dstBAT[PRE_SIZE].bat->tsorted = 0;
+ shredCtx->dstBAT[PRE_SIZE].bat->tdense = 0;
BATkey(BATmirror(shredCtx->dstBAT[PRE_SIZE].bat), FALSE);
}
if (shredCtx->dstBAT[PRE_KIND].bat->tkey == TRUE) {
+ shredCtx->dstBAT[PRE_KIND].bat->tsorted = 0;
+ shredCtx->dstBAT[PRE_KIND].bat->tdense = 0;
BATkey(BATmirror(shredCtx->dstBAT[PRE_KIND].bat), FALSE);
}
}
-------------------------------------------------------------------------
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