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

Modified Files:
      Tag: XQFT
        pathfinder.mx 
Log Message:
propagated changes of Sunday Nov 15 2009 - Thursday Nov 19 2009
from the development trunk to the XQFT branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/15 - stmane: runtime/pathfinder.mx,1.472
  propagated changes of Sunday Nov 15 2009
  from the Nov2009 branch to the development trunk
  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/11/15 - boncz: runtime/pathfinder.mx,1.462.4.9
    modified the disable of MPS (which was until recently still used by queries 
that triggered the module cache)
    - it remains disabled, but queries that explicitly request MPS now again 
get the module code again
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/11/15 - boncz: runtime/pathfinder.mx,1.462.4.10
    - fix in my change earlier today
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/11/19 - sjoerd: runtime/pathfinder.mx,1.473
  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.469.2.2
retrieving revision 1.469.2.3
diff -u -d -r1.469.2.2 -r1.469.2.3
--- pathfinder.mx       12 Nov 2009 08:46:49 -0000      1.469.2.2
+++ pathfinder.mx       19 Nov 2009 12:12:54 -0000      1.469.2.3
@@ -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
 
@@ -5917,7 +5937,6 @@
     return p+1;
 }
 
-#ifdef XQUERY_PREPARE 
 /* 
  * parse an XML datamodel numeric, and determine its minimal type (xs:integer, 
xs:decimal or xs:double) 
  */
@@ -5950,7 +5969,6 @@
  * from a cached MIL tree. Otherwise use pathfinder to compile. Returns error 
string (NULL if ok).
  */
 static char xquery_too_complex[80] = "xquery_prepare: xquery is too complex 
for cached execution.\n";
-#endif
 #define xquery_nondescriptive_error ((char*) -1)
 
 static char*
@@ -5959,11 +5977,24 @@
                char* query) 
 {
     char *err = NULL;
-#ifdef XQUERY_PREPARE 
     int nsbuf = 0, loaded_modules = 0, len;
     char *ns = (char*)&nsbuf, *nsend = ns, *locend, *loc = NULL, *q, *p = 
query;
     char val[1024], url1[1024], url2[1024];
 
+    /* Setting the Algebra flag; server setting overules compile-time default; 
client choice overrules server setting */
+    int options = 0;
+#if MILPRINT_SUMMER_IS_DEFAULT
+         if (((ctx->mode & XQ_ALGEBRA) != 0) || \
+            (((ctx->mode & XQ_MILPRINT_SUMMER) == 0) && \
+              (GDKgetenv("xquery_backend") != NULL) && 
(strcmp(GDKgetenv("xquery_backend"),"algebra") == 0)))
+            options = COMPILE_OPTION_ALGEBRA;
+#else /* ALGEBRA_IS_DEFAULT */
+        if (((ctx->mode & XQ_MILPRINT_SUMMER) == 0) && \
+            (((ctx->mode & XQ_ALGEBRA) != 0) || \
+             (GDKgetenv("xquery_backend") == NULL) || 
(strcmp(GDKgetenv("xquery_backend"),"milprint_summer") != 0)))
+            options = COMPILE_OPTION_ALGEBRA;
+#endif
+if (options != COMPILE_OPTION_ALGEBRA) {
     if (ctx->mode&XQ_DEBUG) {
         /* for debugging purposes, we simulate a full MIL on the log; even if 
parts are cached */
         char *prologue = (char*) PFinitMIL();
@@ -6145,29 +6176,15 @@
      */
     if (err == xquery_function_error) /* MIL execution failed, do not generate 
error in PF compiler */
        return xquery_nondescriptive_error;
-    if (err) 
-#else
-    (void) usec;
-#endif
-    {
+} else {
+    err = xquery_nondescriptive_error;
+}
+    if (err) {
         char *sec1 = NULL;
         char *sec2 = NULL;
         char *sec3 = NULL;
-        int options = 0;
         /* compile and execute the query (minus module imports) */
         err = xquery_nondescriptive_error;
-    /* Setting the Algebra flag; server setting overules compile-time default; 
client choice overrules server setting */
-#if MILPRINT_SUMMER_IS_DEFAULT
-         if (((ctx->mode & XQ_ALGEBRA) != 0) || \
-            (((ctx->mode & XQ_MILPRINT_SUMMER) == 0) && \
-              (GDKgetenv("xquery_backend") != NULL) && 
(strcmp(GDKgetenv("xquery_backend"),"algebra") == 0)))
-            options = COMPILE_OPTION_ALGEBRA;
-#else /* ALGEBRA_IS_DEFAULT */
-        if (((ctx->mode & XQ_MILPRINT_SUMMER) == 0) && \
-            (((ctx->mode & XQ_ALGEBRA) != 0) || \
-             (GDKgetenv("xquery_backend") == NULL) || 
(strcmp(GDKgetenv("xquery_backend"),"milprint_summer") != 0)))
-            options = COMPILE_OPTION_ALGEBRA;
-#endif
         if (xquery_compile_exec(ctx, options, query, 0, &sec1, &sec2, &sec3, 
NULL)) 
                 err = NULL;
         if (sec1) free(sec1);


------------------------------------------------------------------------------
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