Changeset: edf75e0763f7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=edf75e0763f7
Modified Files:
        monetdb5/mal/mal_embedded.c
        sql/server/sql_mvc.c
Branch: cmake-monetdblite
Log Message:

Set embedded scripts initialized only when the MALengine call effectively 
succeeds.


diffs (46 lines):

diff --git a/monetdb5/mal/mal_embedded.c b/monetdb5/mal/mal_embedded.c
--- a/monetdb5/mal/mal_embedded.c
+++ b/monetdb5/mal/mal_embedded.c
@@ -108,7 +108,8 @@ malEmbeddedBoot(void)
                return msg;
        }
        msg = MALengine(c);
-       embeddedinitialized = true;
+       if (msg == MAL_SUCCEED)
+               embeddedinitialized = true;
        MCcloseClient(c);
        return msg;
 }
diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -189,13 +189,13 @@ mvc_init(int debug, store_type store, in
                }
        }
 
+#ifndef HAVE_EMBEDDED
        if(mvc_trans(m) < 0) {
                mvc_destroy(m);
                MT_fprintf(stderr, "!mvc_init: failed to start transaction\n");
                return -1;
        }
 
-#ifndef HAVE_EMBEDDED
        //as the sql_parser is not yet initialized in the storage, we determine 
the sql type of the sql_parts here
        for (node *n = m->session->tr->schemas.set->h; n; n = n->next) {
                sql_schema *ss = (sql_schema*) n->data;
@@ -214,13 +214,13 @@ mvc_init(int debug, store_type store, in
                        }
                }
        }
-#endif
 
        if ((msg = mvc_commit(m, 0, NULL, false)) != MAL_SUCCEED) {
                MT_fprintf(stderr, "!mvc_init: unable to commit system tables: 
%s\n", (msg + 6));
                freeException(msg);
                return -1;
        }
+#endif
 
        mvc_destroy(m);
        return first;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to