Changeset: ef4385034811 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ef4385034811
Modified Files:
        common/options/monet_options.c
        embedded/CMakeLists.txt
        embedded/monetdb_embedded.c
        monetdb5/mal/mal_embedded.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_profiler.h
        monetdb5/modules/mal/bbp.c
        monetdb5/modules/mal/bbp.h
Branch: cmake-monetdblite
Log Message:

MonetDBLite is great again!


diffs (195 lines):

diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -209,7 +209,7 @@ mo_builtin_settings(opt **Set)
                return 0;
 
 #ifdef HAVE_EMBEDDED
-#define N_OPTIONS      1       /*MUST MATCH # OPTIONS BELOW */
+#define N_OPTIONS      2       /*MUST MATCH # OPTIONS BELOW */
 #else
 #define N_OPTIONS      8
 #endif
@@ -223,10 +223,6 @@ mo_builtin_settings(opt **Set)
        set[i].value = strdup(LOCALSTATEDIR DIR_SEP_STR "monetdb5" DIR_SEP_STR 
"dbfarm" DIR_SEP_STR "demo");
        i++;
        set[i].kind = opt_builtin;
-       set[i].name = strdup("monet_prompt");
-       set[i].value = strdup(">");
-       i++;
-       set[i].kind = opt_builtin;
        set[i].name = strdup("mapi_port");
        set[i].value = strdup("50000");
        i++;
@@ -248,6 +244,10 @@ mo_builtin_settings(opt **Set)
        i++;
 #endif
        set[i].kind = opt_builtin;
+       set[i].name = strdup("monet_prompt");
+       set[i].value = strdup(">");
+       i++;
+       set[i].kind = opt_builtin;
        set[i].name = strdup("sql_debug");
        set[i].value = strdup("0");
        i++;
diff --git a/embedded/CMakeLists.txt b/embedded/CMakeLists.txt
--- a/embedded/CMakeLists.txt
+++ b/embedded/CMakeLists.txt
@@ -22,7 +22,6 @@ bison_target(sqlparserlite ../sql/server
                         COMPILE_FLAGS "-d -p sql -r all" DEFINES_FILE 
${CMAKE_CURRENT_BINARY_DIR}/sql_sqlparserlite.tab.h)
 add_library(bisonlite_obj OBJECT ${BISON_sqlparserlite_OUTPUTS})
 set_target_properties(bisonlite_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
-target_compile_definitions(bisonlite_obj PRIVATE HAVE_EMBEDDED)
 if(COMPILER_Wnounreachablecode)
        target_compile_options(bisonlite_obj PRIVATE -Wno-unreachable-code)
 endif()
diff --git a/embedded/monetdb_embedded.c b/embedded/monetdb_embedded.c
--- a/embedded/monetdb_embedded.c
+++ b/embedded/monetdb_embedded.c
@@ -73,7 +73,7 @@ monetdb_connect(monetdb_connection *conn
                msg = createException(MAL, "embedded.monetdb_connect", 
SQLSTATE(42000) "monetdb_connection parameter is NULL");
                goto cleanup;
        }
-       mc = MCinitClient((oid) 0, bstream_create(GDKstdin, 0), GDKstdout);
+       mc = MCinitClient((oid) 0, 0, 0);
        if (!MCvalid(mc)) {
                msg = createException(MAL, "embedded.monetdb_connect", 
SQLSTATE(HY001) "Failed to initialize client");
                goto cleanup;
@@ -248,7 +248,7 @@ monetdb_query_internal(monetdb_connectio
        }
        if (bstream_next(c->fdin) < 0) {
                close_stream(query_stream);
-               throw(MAL, "embedded.monetdb_query_internal", SQLSTATE(HY001) 
"Internal error with ");
+               throw(MAL, "embedded.monetdb_query_internal", SQLSTATE(HY001) 
"Internal error while starting the query");
        }
 
        b->language = language;
@@ -262,15 +262,10 @@ monetdb_query_internal(monetdb_connectio
                goto cleanup;
        if ((msg = SQLparser(c)) != MAL_SUCCEED)
                goto cleanup;
-       if ((msg = SQLparser(c)) != MAL_SUCCEED)
-               goto cleanup;
-
        if (prepare_id && m->emode == m_prepare)
                *prepare_id = b->q->id;
-
        if ((msg = SQLengine(c)) != MAL_SUCCEED)
                goto cleanup;
-
        if (!m->results && m->rowcnt >= 0 && affected_rows)
                *affected_rows = m->rowcnt;
 
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
@@ -74,7 +74,7 @@ malEmbeddedBoot(void)
        initProfiler();
 #endif
 
-       c = MCinitClient((oid) 0, bstream_create(GDKstdin, 0), GDKstdout);
+       c = MCinitClient((oid) 0, 0, 0);
        if(c == NULL)
                throw(MAL, "malEmbeddedBoot", "Failed to initialize client");
        c->curmodule = c->usermodule = userModule();
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -1020,34 +1020,6 @@ getSystemTime(void)
 #endif
 }
 
-lng
-getDiskSpace(void)
-{
-       BAT *b;
-       bat i;
-       lng size = 0;
-
-       for (i = 1; i < getBBPsize(); i++)
-               if (BBP_logical(i) && (BBP_refs(i) || BBP_lrefs(i))) {
-                       b = BATdescriptor(i);
-                       if (b) {
-                               size += sizeof(BAT);
-                               if (!isVIEW(b)) {
-                                       BUN cnt = BATcount(b);
-
-                                       size += tailsize(b, cnt);
-                                       /* the upperbound is used for the heaps 
*/
-                                       if (b->tvheap)
-                                               size += b->tvheap->size;
-                                       if (b->thash)
-                                               size += sizeof(BUN) * cnt;
-                               }
-                               BBPunfix(i);
-                       }
-               }
-       return size;
-}
-
 void profilerGetCPUStat(lng *user, lng *nice, lng *sys, lng *idle, lng *iowait)
 {
        (void) getCPULoad(0);
diff --git a/monetdb5/mal/mal_profiler.h b/monetdb5/mal/mal_profiler.h
--- a/monetdb5/mal/mal_profiler.h
+++ b/monetdb5/mal/mal_profiler.h
@@ -43,8 +43,6 @@ mal_export int initTrace(void);
 mal_export str cleanupTraces(void);
 mal_export BAT *getTrace(const char *ev);
 
-
-mal_export lng getDiskSpace(void);
 mal_export lng getDiskReads(void);
 mal_export lng getDiskWrites(void);
 mal_export lng getUserTime(void);
diff --git a/monetdb5/modules/mal/bbp.c b/monetdb5/modules/mal/bbp.c
--- a/monetdb5/modules/mal/bbp.c
+++ b/monetdb5/modules/mal/bbp.c
@@ -110,6 +110,35 @@ CMDbbpNames(bat *ret)
                throw(MAL, "catalog.bbpNames", GDK_EXCEPTION);
        return MAL_SUCCEED;
 }
+
+lng
+getDiskSpace(void)
+{
+       BAT *b;
+       bat i;
+       lng size = 0;
+
+       for (i = 1; i < getBBPsize(); i++)
+               if (BBP_logical(i) && (BBP_refs(i) || BBP_lrefs(i))) {
+                       b = BATdescriptor(i);
+                       if (b) {
+                               size += sizeof(BAT);
+                               if (!isVIEW(b)) {
+                                       BUN cnt = BATcount(b);
+
+                                       size += tailsize(b, cnt);
+                                       /* the upperbound is used for the heaps 
*/
+                                       if (b->tvheap)
+                                               size += b->tvheap->size;
+                                       if (b->thash)
+                                               size += sizeof(BUN) * cnt;
+                               }
+                               BBPunfix(i);
+                       }
+               }
+       return size;
+}
+
 str
 CMDbbpDiskSpace(lng *ret)
 {
diff --git a/monetdb5/modules/mal/bbp.h b/monetdb5/modules/mal/bbp.h
--- a/monetdb5/modules/mal/bbp.h
+++ b/monetdb5/modules/mal/bbp.h
@@ -27,6 +27,8 @@
 #define getcwd _getcwd
 #endif
 
+mal_export lng getDiskSpace(void);
+
 mal_export str CMDbbpbind(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 mal_export str CMDbbpDiskSpace(lng *ret);
 mal_export str CMDgetPageSize(int *ret);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to