Update of /cvsroot/monetdb/pathfinder/runtime
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9969/runtime

Modified Files:
        pathfinder.mx 
Log Message:
propagated changes of Wednesday Nov 18 2009 - Thursday Nov 19 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/18 - sjoerd: runtime/pathfinder.mx,1.462.4.11
  Maintain a sort of database schema version number which can be checked
  to fix the database schema after an upgrade.  We now use the absence
  of this version number to trigger a removal of the old-style (pre
  Nov2009) index.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: pathfinder.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/pathfinder.mx,v
retrieving revision 1.472
retrieving revision 1.473
diff -u -d -r1.472 -r1.473
--- pathfinder.mx       15 Nov 2009 23:00:50 -0000      1.472
+++ pathfinder.mx       19 Nov 2009 10:12:02 -0000      1.473
@@ -4279,6 +4279,25 @@
     pf_checkpoint(bat(str,void).key(true).reverse().append("uri_lifetime"), 
true);
 }
 
+# check whether this is an older version of the database that needs some 
conversion
+{
+    var xqprops;
+    if (not(isnil(CATCH(count(xqprops := bat("xquery_props")))))) {
+        xqprops := 
bat(str,str).rename("xquery_props").insert("version","Nov2009").persists(true);
+        var b := view_bbp_name().reverse().mirror();
+        var d := bat(void,str);
+        d.append(reverse([endsWith](b, "vx_hsh_nid").uselect(true)));
+        d.append(reverse([endsWith](b, "qn_nid").uselect(true)));
+        if (bit(count(d))) {
+            printf("# Databases created with a version older than Nov2009 
detected:\n");
+            printf("# destroying old value-indices..\n"); 
+            printf("# (for optimal performance, re-shred all your 
documents)\n"); 
+            [persists]([bat](d), false);
+        }  
+        subcommit(d.append("xquery_props"));
+    }
+}
+
 # initialize uri_lifetime
 { var b := 
split(monet_environment.find("xquery_cacherules"),";").seqbase(0...@0);
   var i := [r_search](b,"=").select(2,int_nil);
@@ -4292,11 +4311,12 @@
 collection_cleanup(_collection_cleanup()); # silently clean up the repository
 
 mapi_register(xquery_frontend()); # open up mapi client access
-if (monet_environment.find("monet_welcome") = "yes") 
+if (monet_environment.find("monet_welcome") = "yes") {
     printf("%c MonetDB/XQuery module v0.28.3 loaded (default back-end is 
'%s')\n", int(35), monet_environment.find("xquery_backend"));
     #                                 ^^^^^^
     # Maintained via vertoo. Please don't modify by hand!
     # Contact [email protected] for details and/or 
assistance.
+}
 rpcd_start();                     # open up xrpc access
 fork(pf_logmanager());            # start checkpointing thread
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to