Changeset: 404fa0bd1997 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=404fa0bd1997
Modified Files:
        clients/Tests/exports.stable.out
        common/options/monet_options.c
        common/utils/msabaoth.c
        gdk/gdk_join.c
        monetdb5/extras/rapi/rapi.c
        monetdb5/modules/atoms/json.c
        sql/backends/monet5/bam/bam_export.c
        sql/backends/monet5/bam/bam_loader.c
        sql/backends/monet5/bam/bam_wrapper.c
        sql/benchmarks/tpch/Tests/02-explain.stable.out
        sql/benchmarks/tpch/Tests/02-plan.stable.out
        sql/benchmarks/tpch/Tests/17-explain.stable.out
        sql/benchmarks/tpch/Tests/17-plan.stable.out
        sql/benchmarks/tpch/Tests/20-explain.stable.out
        sql/benchmarks/tpch/Tests/20-plan.stable.out
        sql/server/rel_optimizer.c
        sql/server/sql_mvc.c
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/argvcmds.c
        tools/merovingian/daemon/connections.c
        tools/merovingian/daemon/controlrunner.c
        tools/merovingian/daemon/discoveryrunner.c
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/multiplex-funnel.c
        tools/merovingian/daemon/peering.c
        tools/merovingian/daemon/proxy.c
        tools/merovingian/utils/utils.c
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 2575 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2266,7 +2266,7 @@ Scenario findScenario(str nme);
 Symbol findSymbol(Module nspace, str mod, str fcn);
 Symbol findSymbolInModule(Module v, str fcn);
 int findTmpVariable(MalBlkPtr mb, int type);
-int findVariable(MalBlkPtr mb, str name);
+int findVariable(MalBlkPtr mb, const char *name);
 int findVariableLength(MalBlkPtr mb, str name, int len);
 void finishNamespace(void);
 str finishRef;
@@ -2395,7 +2395,7 @@ int isProcedure(MalBlkPtr mb, InstrPtr p
 int isSideEffectFree(MalBlkPtr mb);
 int isSlice(InstrPtr q);
 int isSubSelect(InstrPtr q);
-int isTmpName(str n);
+int isTmpName(const char *n);
 int isTopn(InstrPtr q);
 int isTypeName(str n);
 int isUnsafeFunction(InstrPtr q);
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
@@ -125,9 +125,9 @@ mo_config_file(opt **Set, int setlen, ch
                if (default_set == NULL) {
                        set = NULL;
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        set = *Set;
        fd = fopen(file, "r");
@@ -209,9 +209,9 @@ mo_system_config(opt **Set, int setlen)
                        opt *set = NULL;
 
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        cfg = mo_find_option(*Set, setlen, "config");
        if (!cfg)
@@ -305,9 +305,9 @@ mo_add_option(opt **Set, int setlen, opt
                if (default_set == NULL) {
                        set = NULL;
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        set = (opt *) realloc(*Set, (setlen + 1) * sizeof(opt));
        set[setlen].kind = kind;
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -65,15 +65,15 @@ char *_sabaoth_internal_uuid = NULL;
  * Retrieves the dbfarm path plus an optional extra component added
  */
 static char *
-getFarmPath(char **ret, size_t size, const char *extra)
+getFarmPath(char *pathbuf, size_t size, const char *extra)
 {
        if (_sabaoth_internal_dbfarm == NULL)
                return(strdup("sabaoth not initialized"));
 
        if (extra == NULL) {
-               snprintf(*ret, size, "%s", _sabaoth_internal_dbfarm);
+               snprintf(pathbuf, size, "%s", _sabaoth_internal_dbfarm);
        } else {
-               snprintf(*ret, size, "%s%c%s",
+               snprintf(pathbuf, size, "%s%c%s",
                                _sabaoth_internal_dbfarm, DIR_SEP, extra);
        }
 
@@ -85,7 +85,7 @@ getFarmPath(char **ret, size_t size, con
  * component added
  */
 static char *
-getDBPath(char **ret, size_t size, const char *extra)
+getDBPath(char *pathbuf, size_t size, const char *extra)
 {
        if (_sabaoth_internal_dbfarm == NULL)
                return(strdup("sabaoth not initialized"));
@@ -93,10 +93,10 @@ getDBPath(char **ret, size_t size, const
                return(strdup("sabaoth was not initialized as active 
database"));
 
        if (extra == NULL) {
-               snprintf(*ret, size, "%s%c%s",
+               snprintf(pathbuf, size, "%s%c%s",
                                _sabaoth_internal_dbfarm, DIR_SEP, 
_sabaoth_internal_dbname);
        } else {
-               snprintf(*ret, size, "%s%c%s%c%s",
+               snprintf(pathbuf, size, "%s%c%s%c%s",
                                _sabaoth_internal_dbfarm, DIR_SEP,
                                _sabaoth_internal_dbname, DIR_SEP, extra);
        }
@@ -206,13 +206,12 @@ msab_marchScenario(const char *lang)
        char buf[256];  /* should be enough for now */
        size_t len;
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, SCENARIOFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), SCENARIOFILE)) != NULL)
                return(tmp);
 
-       if ((f = fopen(path, "a+")) != NULL) {
+       if ((f = fopen(pathbuf, "a+")) != NULL) {
                if ((len = fread(buf, 1, 255, f)) > 0) {
                        char *p;
 
@@ -235,7 +234,7 @@ msab_marchScenario(const char *lang)
                return(NULL);
        }
        snprintf(buf, sizeof(buf), "failed to open file: %s (%s)",
-                       strerror(errno), path);
+                       strerror(errno), pathbuf);
        return(strdup(buf));
 }
 
@@ -251,13 +250,12 @@ msab_retreatScenario(const char *lang)
        char buf[256];  /* should be enough to hold the entire file */
        size_t len;
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, SCENARIOFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), SCENARIOFILE)) != NULL)
                return(tmp);
 
-       if ((f = fopen(path, "a+")) != NULL) {
+       if ((f = fopen(pathbuf, "a+")) != NULL) {
                if ((len = fread(buf, 1, 255, f)) > 0) {
                        char *p;
                        char written = 0;
@@ -281,7 +279,7 @@ msab_retreatScenario(const char *lang)
                                if (fwrite(buf, 1, len, f) < len) {
                                        (void)fclose(f);
                                        snprintf(buf, sizeof(buf), "failed to 
write: %s (%s)",
-                                                       strerror(errno), path);
+                                                       strerror(errno), 
pathbuf);
                                        return(strdup(buf));
                                }
                                fflush(f);
@@ -289,24 +287,24 @@ msab_retreatScenario(const char *lang)
                                return(NULL);
                        } else {
                                (void)fclose(f);
-                               unlink(path);
+                               unlink(pathbuf);
                                return(NULL);
                        }
                } else {
                        if (ferror(f)) {
                                /* some error */
                                snprintf(buf, sizeof(buf), "failed to write: %s 
(%s)",
-                                        strerror(errno), path);
+                                        strerror(errno), pathbuf);
                                (void)fclose(f);
                                return strdup(buf);
                        } else
-                               unlink(path);  /* empty file? try to remove */
+                               unlink(pathbuf);  /* empty file? try to remove 
*/
                        (void)fclose(f);
                        return(NULL);
                }
        }
        snprintf(buf, sizeof(buf), "failed to open file: %s (%s)",
-                       strerror(errno), path);
+                       strerror(errno), pathbuf);
        return(strdup(buf));
 }
 
@@ -323,17 +321,16 @@ msab_marchConnection(const char *host, c
 {
        FILE *f;
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, CONNECTIONFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), CONNECTIONFILE)) != NULL)
                return(tmp);
 
        if (port <= 0 && host[0] != '/')
                return(strdup("UNIX domain connections should be given as "
                                        "absolute path"));
 
-       if ((f = fopen(path, "a")) != NULL) {
+       if ((f = fopen(pathbuf, "a")) != NULL) {
                /* append to the file */
                if (port > 0) {
                        fprintf(f, "mapi:monetdb://%s:%i/\n", host, port);
@@ -346,7 +343,7 @@ msab_marchConnection(const char *host, c
        } else {
                char buf[PATHLENGTH + 1024];
                snprintf(buf, sizeof(buf), "failed to open file: %s (%s)",
-                               strerror(errno), path);
+                               strerror(errno), pathbuf);
                return(strdup(buf));
        }
 }
@@ -361,24 +358,23 @@ char *
 msab_wildRetreat(void)
 {
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, SCENARIOFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), SCENARIOFILE)) != NULL)
                return(tmp);
-       unlink(path);
+       unlink(pathbuf);
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, CONNECTIONFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), CONNECTIONFILE)) != NULL)
                return(tmp);
-       unlink(path);
+       unlink(pathbuf);
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, STARTEDFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), STARTEDFILE)) != NULL)
                return(tmp);
-       unlink(path);
+       unlink(pathbuf);
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, _sabaoth_internal_uuid)) != 
NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), _sabaoth_internal_uuid)) 
!= NULL)
                return(tmp);
-       unlink(path);
+       unlink(pathbuf);
 
        return(NULL);
 }
@@ -401,13 +397,12 @@ msab_registerStarting(void)
 
        FILE *f;
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
 
-       if ((tmp = getDBPath(&path, PATHLENGTH, UPLOGFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), UPLOGFILE)) != NULL)
                return(tmp);
 
-       if ((f = fopen(path, "a")) != NULL) {
+       if ((f = fopen(pathbuf, "a")) != NULL) {
                /* append to the file */
                fprintf(f, LLFMT "\t", (lng)time(NULL));
                (void)fflush(f);
@@ -415,25 +410,25 @@ msab_registerStarting(void)
        } else {
                char buf[PATHLENGTH];
                snprintf(buf, sizeof(buf), "failed to open file: %s (%s)",
-                               strerror(errno), path);
+                               strerror(errno), pathbuf);
                return(strdup(buf));
        }
 
        /* we treat errors here (albeit being quite unlikely) as non-fatal,
         * since they will cause wrong state information in the worst case
         * later on */
-       if ((tmp = getDBPath(&path, PATHLENGTH, _sabaoth_internal_uuid)) != 
NULL) {
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), _sabaoth_internal_uuid)) 
!= NULL) {
                free(tmp);
                return(NULL);
        }
-       f = fopen(path, "w");
+       f = fopen(pathbuf, "w");
        if (f)
                fclose(f);
 
        /* remove any stray file that would suggest we've finished starting up 
*/
-       if ((tmp = getDBPath(&path, PATHLENGTH, STARTEDFILE)) != NULL)
+       if ((tmp = getDBPath(pathbuf, sizeof(pathbuf), STARTEDFILE)) != NULL)
                return(tmp);
-       unlink(path);
+       unlink(pathbuf);
 
 
        return(NULL);
@@ -448,14 +443,13 @@ char *
 msab_registerStarted(void)
 {
        char pathbuf[PATHLENGTH];
-       char *path = pathbuf;
        char *tmp;
        FILE *fp;
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to