Changeset: 3497d93e9d82 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3497d93e9d82
Modified Files:
        MonetDB.spec
        NT/monetdb_config.h.in
        sql/backends/monet5/Makefile.ag
Branch: default
Log Message:

Merge with Aug2011 branch.


diffs (truncated from 1118 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -436,7 +436,12 @@ use SQL with MonetDB, you will need to i
 %{_bindir}/monetdb
 %{_bindir}/monetdbd
 %dir %attr(775,monetdb,monetdb) %{_localstatedir}/log/monetdb
+%if ! (0%{?fedora} > 14)
 %dir %attr(775,monetdb,monetdb) %{_localstatedir}/run/monetdb
+%exclude %{_sysconfdir}/tmpfiles.d/monetdbd.conf
+%else
+%{_sysconfdir}/tmpfiles.d/monetdbd.conf
+%endif
 %config(noreplace) %{_localstatedir}/monetdb5/dbfarm/.merovingian_properties
 %{_libdir}/monetdb5/autoload/*_sql.mal
 %{_libdir}/monetdb5/lib_sql.so
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -600,8 +600,6 @@
 
 /* Define to 1 if you have the timezone and daylight variables. */
 #define HAVE_TIMEZONE 1
-#define timezone _timezone
-#define daylight _daylight
 
 /* Define to 1 if you have the `trunc' function. */
 /* #undef HAVE_TRUNC */
diff --git a/buildtools/ChangeLog.Aug2011 b/buildtools/ChangeLog.Aug2011
--- a/buildtools/ChangeLog.Aug2011
+++ b/buildtools/ChangeLog.Aug2011
@@ -1,6 +1,10 @@
 # ChangeLog file for buildtools
 # This file is updated with Maddlog
 
+* Sat Aug  6 2011 Sjoerd Mullender <[email protected]>
+- Fixed Fedora 15 (and presumably later) configuration that uses a tmpfs
+  file system for /var/run.  This fixes bug 2850.
+
 * Wed Jul 20 2011 Sjoerd Mullender <[email protected]>
 - The default OID size for 64-bit Windows is now 64 bits.  Databases with
   32 bit OIDs are converted automatically.
diff --git a/buildtools/conf/Makefile.ag b/buildtools/conf/Makefile.ag
--- a/buildtools/conf/Makefile.ag
+++ b/buildtools/conf/Makefile.ag
@@ -50,4 +50,11 @@ headers_html = {
        SOURCES = website.html
 }
 
+headers_systemd = {
+       COND = NOT_WIN32
+       HEADERS = conf
+       DIR = sysconfdir/tmpfiles.d
+       SOURCES = monetdbd.conf
+}
+
 EXTRA_DIST = rules.mk
diff --git a/buildtools/conf/monetdbd.conf b/buildtools/conf/monetdbd.conf
new file mode 100644
--- /dev/null
+++ b/buildtools/conf/monetdbd.conf
@@ -0,0 +1,3 @@
+# this file is for systemd
+# monetdbd needs a directory in /var/run that is owned by monetdb:monetdb
+d /run/monetdb 0775 monetdb monetdb -
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2362,6 +2362,11 @@ static void
 set_timezone(Mapi mid)
 {
 #ifdef HAVE_TIMEZONE
+#ifdef _MSC_VER
+#define timezone _timezone
+#define daylight _daylight
+#define tzset _tzset
+#endif
        char buf[128];
        long tzone;
        MapiHdl hdl;
diff --git a/gdk/gdk.mx b/gdk/gdk.mx
--- a/gdk/gdk.mx
+++ b/gdk/gdk.mx
@@ -2288,8 +2288,6 @@ gdk_export void *GDKrealloc(void *pold, 
 gdk_export void GDKfree(void *blk);
 gdk_export str GDKstrdup(const char *s);
 
-gdk_export void *GDKvmalloc(size_t size, size_t * maxsize, int emergency);
-
 /*
  * @- GDK error handling
  *  @multitable @columnfractions 0.08 0.7
diff --git a/gdk/gdk_batop.mx b/gdk/gdk_batop.mx
--- a/gdk/gdk_batop.mx
+++ b/gdk/gdk_batop.mx
@@ -439,10 +439,10 @@ BATins(BAT *b, BAT *n, bit force)
 BAT *
 BATappend(BAT *b, BAT *n, bit force)
 {
-       BUN sz = BATcount(n);
+       BUN sz;
        int fastpath = 1;
 
-       if (b == NULL || n == NULL || sz == 0) {
+       if (b == NULL || n == NULL || (sz = BATcount(n)) == 0) {
                return b;
        }
        ALIGNapp(b, "BATappend", force);
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -57,6 +57,7 @@ BUN SORTfndlast(BAT *b, ptr v);
 int GDKmunmap(void *addr, size_t len);
 void *GDKmallocmax(size_t size, size_t *maxsize, int emergency);
 void *GDKreallocmax(void *pold, size_t size, size_t *maxsize, int emergency);
+void *GDKvmalloc(size_t size, size_t * maxsize, int emergency);
 void *GDKvmrealloc(void *pold, size_t oldsize, size_t newsize, size_t oldmax, 
size_t *maxsize, int emergency);
 void GDKvmfree(void *blk, size_t size, size_t maxsize);
 void GDKaddbuf(const char *msg);
diff --git a/monetdb5/extras/crackers/crackers_joins.mx 
b/monetdb5/extras/crackers/crackers_joins.mx
--- a/monetdb5/extras/crackers/crackers_joins.mx
+++ b/monetdb5/extras/crackers/crackers_joins.mx
@@ -121,13 +121,17 @@ crackers_export str CRKsortBandJoin_@1(i
 
                        _step = _lcount / (_slices -= SAMPLE_TRESHOLD_LOG);
                        _sample = _slices * SAMPLE_SLICE_SIZE;
-                       _cnt = (BUN *) alloca(_slices * sizeof(BUN));
+                       _cnt = GDKmalloc(_slices * sizeof(BUN));
+                       if (_cnt == NULL)
+                               return NULL;
                        for (_lo = 0; _idx < _slices; _lo += _step) {
                                BUN _size = 0, _hi = _lo + SAMPLE_SLICE_SIZE;
 
                                l = BATslice(_tmp1, _lo, _hi);  /* slice keeps 
all parent properties */
-                               if (l == NULL)
+                               if (l == NULL) {
+                                       GDKfree(_cnt);
                                        return NULL;
+                               }
                                _tmp2 = @2;     /* @2 = e.g. BATXjoin(l,r) */
                                if (_tmp2) {
                                        _size = BATcount(_tmp2);
@@ -158,10 +162,13 @@ crackers_export str CRKsortBandJoin_@1(i
                                                }
                                                BBPreclaim(_tmp2);
                                        }
-                                       if (_tmp3 == NULL)
+                                       if (_tmp3 == NULL) {
+                                               GDKfree(_cnt);
                                                return NULL;
+                                       }
                                }
                        }
+                       GDKfree(_cnt);
                        /* overestimate always by 5% */
                        {
                                double _d = (double) (((lng) _tot) * ((lng) 
_lcount)) / (0.95 * (double) _sample);
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -57,7 +57,7 @@ lib__sql = {
                   ../../../gdk/libbat \
                   ../../../common/stream/libstream \
                   $(READLINE_LIBS) $(PTHREAD_LIBS) \
-                  $(raptor_LIBS)
+                  $(raptor_LIBS) $(MATH_LIBS)
 }
 
 
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -1418,7 +1418,6 @@ sql5_export void freeVariables(Client c,
 #include <rel_exp.h>
 #include <rel_dump.h>
 #include <rel_bin.h>
-#include <math.h>
 #include <bbp.h>
 #include <cluster.h>
 #include <opt_dictionary.h>
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -676,7 +676,7 @@ create_idx(sql_trans *tr, sql_idx *ni)
        if (!bat)
                ni->data = bat = ZNEW(sql_delta);
        if (!bat->name) 
-               bat->name = sql_message("%s_%s_%s", ni->t->s->base.name, 
ni->t->base.name, ni->base.name);
+               bat->name = sql_message("%s_%s@%s", ni->t->s->base.name, 
ni->t->base.name, ni->base.name);
 
        /* create bats for a loaded idx structure */
        if (ni->base.flag == TR_OLD && !isTempTable(ni->t)){
diff --git a/sql/storage/restrict/restrict_storage.c 
b/sql/storage/restrict/restrict_storage.c
--- a/sql/storage/restrict/restrict_storage.c
+++ b/sql/storage/restrict/restrict_storage.c
@@ -442,7 +442,7 @@ create_idx(sql_trans *tr, sql_idx *ni)
        if (!bat)
                ni->data = bat = ZNEW(sql_bat);
        if (!bat->name) 
-               bat->name = sql_message("%s_%s_%s", ni->t->s->base.name, 
ni->t->base.name, ni->base.name);
+               bat->name = sql_message("%s_%s@%s", ni->t->s->base.name, 
ni->t->base.name, ni->base.name);
 
 
 
diff --git a/tools/merovingian/ChangeLog.Aug2011 
b/tools/merovingian/ChangeLog.Aug2011
--- a/tools/merovingian/ChangeLog.Aug2011
+++ b/tools/merovingian/ChangeLog.Aug2011
@@ -1,6 +1,10 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+* Sat Aug  6 2011 Fabian Groffen <[email protected]>
+- Fix incorrect (misleading) path for pidfile in pidfile error message,
+  bug #2851
+
 * Fri Apr 29 2011 Fabian Groffen <[email protected]>
 - added status property to get command
 
diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -266,7 +266,7 @@ printStatus(sabdb *stats, int mode, int 
                char *state;
                char uptime[12];
                char avg[8];
-               char *crash;
+               char crash[20];
                char *dbname;
 
                switch (stats->state) {
@@ -288,12 +288,11 @@ printStatus(sabdb *stats, int mode, int 
                        state = "locked ";
 
                if (uplog.lastcrash == -1) {
-                       crash = "-";
+                       snprintf(crash, sizeof(crash), "-");
                } else {
                        struct tm *t;
-                       crash = alloca(sizeof(char) * 20);
                        t = localtime(&uplog.lastcrash);
-                       strftime(crash, 20, "%Y-%m-%d %H:%M:%S", t);
+                       strftime(crash, sizeof(crash), "%Y-%m-%d %H:%M:%S", t);
                }
 
                if (stats->state != SABdbRunning) {
@@ -303,12 +302,13 @@ printStatus(sabdb *stats, int mode, int 
                }
 
                /* cut too long database names */
-               dbname = alloca(sizeof(char) * (twidth + 1));
+               dbname = malloc(sizeof(char) * (twidth + 1));
                abbreviateString(dbname, stats->dbname, twidth);
                /* dbname | state | uptime | health */
                secondsToString(avg, uplog.avguptime, 1);
-                       printf("%-*s  %s %12s", twidth,
-                                       dbname, state, uptime);
+               printf("%-*s  %s %12s", twidth,
+                               dbname, state, uptime);
+               free(dbname);
                if (uplog.startcntr)
                        printf("  %3d%%, %3s  %s",
                                        100 - (uplog.crashcntr * 100 / 
uplog.startcntr),
@@ -775,7 +775,7 @@ command_discover(int argc, char *argv[])
        char *buf;
        char *p, *q;
        size_t twidth = TERMWIDTH;
-       char location[twidth + 1];
+       char *location;
        char *match = NULL;
        size_t numlocs = 50;
        size_t posloc = 0;
@@ -809,6 +809,7 @@ command_discover(int argc, char *argv[])
                        fprintf(stderr, "%s: %s\n", argv[0], p);
                        exit(1);
                }
+               location = malloc(twidth + 1);
                while ((p = strtok(NULL, "\n")) != NULL) {
                        if ((q = strchr(p, '\t')) == NULL) {
                                /* doesn't look correct */
@@ -832,6 +833,7 @@ command_discover(int argc, char *argv[])
                                        loclen = strlen(location);
                        }
                }
+               free(location);
        }
 
        free(buf);
@@ -867,6 +869,7 @@ command_startstop(int argc, char *argv[]
        char *type = NULL;
        char *action = NULL;
        char *p;
+       char *nargv[64];
 
        switch (mode) {
                case START:
@@ -930,7 +933,7 @@ command_startstop(int argc, char *argv[]
                orig = stats;
        }
 
-       argv = alloca(sizeof(char *) * 64);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to