Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16:/tmp/cvs-serv6200/src/backends/monet5

Modified Files:
      Tag: SQL_2-16
        embeddedclient.mx sql_scenario.mx 
Log Message:
fixes Mbeddedsql5 


Index: sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.243.2.4
retrieving revision 1.243.2.5
diff -u -d -r1.243.2.4 -r1.243.2.5
--- sql_scenario.mx     1 Apr 2007 11:53:49 -0000       1.243.2.4
+++ sql_scenario.mx     20 Apr 2007 13:34:59 -0000      1.243.2.5
@@ -141,7 +141,9 @@
        /* s->optimizer = "SQLoptimizer";
         * s->tactics = .. */
        s->engine = "SQLengine";
-       return SABAOTHmarchScenario(&res, &s->name);
+       if (!GDKembedded)
+               return SABAOTHmarchScenario(&res, &s->name);
+       return MAL_SUCCEED;
 }
 
 str
@@ -158,7 +160,9 @@
        }
        /* this function is never called, but for the style of it, we clean
         * up our own mess */
-       return SABAOTHretreatScenario(&res, &s);
+       if (!GDKembedded)
+               return SABAOTHretreatScenario(&res, &s);
+       return MAL_SUCCEED;
 }
 
 str

Index: embeddedclient.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/embeddedclient.mx,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -u -d -r1.10.2.1 -r1.10.2.2
--- embeddedclient.mx   20 Apr 2007 11:19:41 -0000      1.10.2.1
+++ embeddedclient.mx   20 Apr 2007 13:34:59 -0000      1.10.2.2
@@ -133,16 +133,12 @@
                GDK_mem_bigsize = strtol(p, NULL, 10);
        if ((p = GDKgetenv("gdk_vm_minsize")) != NULL)
                GDK_vm_minsize = strtol(p, NULL, 10);
-       if (GDKgetenv_isyes("gdk_embedded")) {
-               GDKembedded = 1;
-       }
-
        if (GDKgetenv_isyes("monet_daemon"))
                monet_daemon = 1;
-       if (GDKgetenv_isyes("monet_embedded")) {
-               monet_daemon = 1;
-               GDKembedded = 1;
-       }
+
+       GDKsetenv("gdk_embedded", "yes");
+       GDKsetenv("monet_embedded", "yes");
+       GDKembedded = 1;
 }
 
 static opt *embedded_set = NULL;
@@ -166,6 +162,29 @@
                mo_free_options(embedded_set, embedded_len);
                if (mal_init())
                        return 0;
+               {
+                       /* unlock the vault, first see if we can find the file 
which
+                        * holds the secret */
+                       char* secret = alloca(sizeof(char) * 1024);
+                       FILE* secretf;
+                       size_t len;
+                       
+                       if (GDKgetenv("monet_vault_key") == NULL) {
+                               /* use a default (hard coded, non safe) key */
+                               secret = "Xas632jsi2whjds8";
+                       } else {
+                               if ((secretf = 
fopen(GDKgetenv("monet_vault_key"), "r")) == NULL) 
+                                       return 0;
+                               len = fread(secret, 1, 1023, secretf);
+                               secret[len] = '\0';
+                               fclose(secretf);
+                       }
+                       if (AUTHunlockVault(&secret) != MAL_SUCCEED)
+                               return 0;
+               }
+               /* make sure the authorisation BATs are loaded */
+               if (AUTHinitTables() != MAL_SUCCEED)
+                       return 0;
                MSinitClientPrg(mal_clients, "user","main");
                initialized = 1;
        }
@@ -175,9 +194,9 @@
        free(arg);
        snprintf(buf, sizeof(buf), 
                "include sql;\n"
-               "in  := \"" PTRFMT "\":stream;\n"
-               "out := \"" PTRFMT "\":stream;\n"
-               "mapi.malclient(in, out);\n", PTRFMTCAST in, PTRFMTCAST out);
+               "in  := \"" PTRFMT "\":streams;\n"
+               "out := \"" PTRFMT "\":streams;\n"
+               "mserver.malclient(in, out);\n", PTRFMTCAST in, PTRFMTCAST out);
        callString(mal_clients, buf, 0);
        return NULL;
 }


-------------------------------------------------------------------------
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-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to