Changeset: 6d912fd838af for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d912fd838af
Modified Files:
        configure.ag
        gdk/gdk_colop.c
        gdk/gdk_logger.c
        gdk/gdk_posix.c
        gdk/gdk_relop.c
        gdk/gdk_setop.c
        gdk/gdk_storage.c
        gdk/gdk_utils.c
        geom/lib/libgeom.c
        geom/lib/libgeom.h
        geom/monetdb5/geom.mx
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/modules/kernel/aggr_bge_count.mx
        monetdb5/modules/mal/mkey.c
        monetdb5/modules/mal/remote.c
        monetdb5/optimizer/opt_mergetable.c
        sql/backends/monet5/sql.mx
Branch: headless
Log Message:

Merge with default branch.


diffs (truncated from 1914 to 300 lines):

diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -49,7 +49,8 @@
        NOINST
        SOURCES = mnc.c
        LIBS = ../../common/stream/libstream \
-               $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS)
+               ../mapilib/libmapi \
+               $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS)
 }
 
 man_MANS = mclient.1 msqldump.1
diff --git a/clients/mapiclient/mnc.c b/clients/mapiclient/mnc.c
--- a/clients/mapiclient/mnc.c
+++ b/clients/mapiclient/mnc.c
@@ -41,8 +41,15 @@
 #include <pthread.h>
 #endif
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef NATIVE_WIN32
+# include <winsock.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
 
 #ifndef HAVE_GETOPT_LONG
 # include "monet_getopt.h"
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3287,19 +3287,19 @@
                        switch (hdl->params[i].intype) {
                        case MAPI_TINY:
                                checkSpace(5);
-                               sprintf(hdl->query + k, "%d", *(signed char *) 
src);
+                               sprintf(hdl->query + k, "%hhd", *(signed char 
*) src);
                                break;
                        case MAPI_UTINY:
                                checkSpace(5);
-                               sprintf(hdl->query + k, "%u", *(unsigned char 
*) src);
+                               sprintf(hdl->query + k, "%hhu", *(unsigned char 
*) src);
                                break;
                        case MAPI_SHORT:
                                checkSpace(10);
-                               sprintf(hdl->query + k, "%d", *(short *) src);
+                               sprintf(hdl->query + k, "%hd", *(short *) src);
                                break;
                        case MAPI_USHORT:
                                checkSpace(10);
-                               sprintf(hdl->query + k, "%u", *(unsigned short 
*) src);
+                               sprintf(hdl->query + k, "%hu", *(unsigned short 
*) src);
                                break;
                        case MAPI_INT:
                                checkSpace(20);
@@ -3336,7 +3336,7 @@
                        case MAPI_DATE:
                                checkSpace(50);
                                sprintf(hdl->query + k,
-                                       "DATE '%04d-%02u-%02u'",
+                                       "DATE '%04hd-%02hu-%02hu'",
                                        ((MapiDate *) src)->year,
                                        ((MapiDate *) src)->month,
                                        ((MapiDate *) src)->day);
@@ -3344,7 +3344,7 @@
                        case MAPI_TIME:
                                checkSpace(60);
                                sprintf(hdl->query + k,
-                                       "TIME '%02u:%02u:%02u'",
+                                       "TIME '%02hu:%02hu:%02hu'",
                                        ((MapiTime *) src)->hour,
                                        ((MapiTime *) src)->minute,
                                        ((MapiTime *) src)->second);
@@ -3352,7 +3352,7 @@
                        case MAPI_DATETIME:
                                checkSpace(110);
                                sprintf(hdl->query + k,
-                                       "TIMESTAMP '%04d-%02u-%02u 
%02u:%02u:%02u.%09u'",
+                                       "TIMESTAMP '%04hd-%02hu-%02hu 
%02hu:%02hu:%02hu.%09u'",
                                        ((MapiDateTime *) src)->year,
                                        ((MapiDateTime *) src)->month,
                                        ((MapiDateTime *) src)->day,
diff --git a/clients/odbc/driver/ODBCConvert.c 
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -2862,7 +2862,10 @@
                        }
                        /* fall through */
                case SQL_C_TYPE_DATE:
-                       snprintf(data, sizeof(data), "DATE '%u-%02u-%02u'", 
dval.year, dval.month, dval.day);
+                       snprintf(data, sizeof(data), "DATE '%u-%02u-%02u'",
+                                (unsigned int) dval.year,
+                                (unsigned int) dval.month,
+                                (unsigned int) dval.day);
                        assigns(buf, bufpos, buflen, data, stmt);
                        break;
                default:
@@ -2961,7 +2964,7 @@
                        /* fall through */
                case SQL_C_TYPE_TIMESTAMP:
                        snprintf(data, sizeof(data),
-                                "TIMESTAMP '%u-%02d-%02d %02u:%02u:%02u",
+                                "TIMESTAMP '%u-%02u-%02u %02u:%02u:%02u",
                                 (unsigned int) tsval.year,
                                 (unsigned int) tsval.month,
                                 (unsigned int) tsval.day,
diff --git a/clients/perl/Cimpl/Makefile.ag b/clients/perl/Cimpl/Makefile.ag
--- a/clients/perl/Cimpl/Makefile.ag
+++ b/clients/perl/Cimpl/Makefile.ag
@@ -24,14 +24,14 @@
 #  GCC_SWIG_CFLAGS and ICC_SWIG_CFLAGS, respectively, to disable only
 #  the problematic warnings/errors as locally as possible.  See
 #  configure.ag for details.
-#CFLAGS = $(GCC_SWIG_CFLAGS) $(ICC_SWIG_CFLAGS) -D_GNU_SOURCE
+CFLAGS = $(GCC_SWIG_CFLAGS) $(ICC_SWIG_CFLAGS) -D_GNU_SOURCE
 #
 #  However, at least with gcc 4.2.2 and swig 1.3.31 on Gentoo 1.12.9,
 #  we still get
 #  MapiLib.pm.c: In function 'boot_MapiLib':
 #  MapiLib.pm.c:6157: warning: passing argument 2 of '_swig_create_magic' 
discards qualifiers from pointer target type
 #  Hence, we have to disable (override) our X_CFLAGS completely:
-X_CFLAGS = -D_GNU_SOURCE
+#X_CFLAGS = -D_GNU_SOURCE
 
 #  Likewise, we need to disable W_CFLAGS=-WX (i.e., treating warnings
 #  as errors) for swig-generated code on Windows
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -661,10 +661,18 @@
        dnl  Be rigid; MonetDB code is supposed to adhere to this... ;-)
        dnl  Let warning #266 "function declared implicitly" become an error.
        X_CFLAGS="$X_CFLAGS -we266"
+       dnl  Let remark #181 "argument is incompatible with corresponding 
format string conversion" become an error.
+       X_CFLAGS="$X_CFLAGS -we181"
+       dnl  Let remark #810 "conversion from "." to "." may lose significant 
bits" become an error.
+       X_CFLAGS="$X_CFLAGS -we810"
+       dnl  Let remark #111 "statement is unreachable" become an error.
+       X_CFLAGS="$X_CFLAGS -we111"
+       dnl  Let remark #271: "trailing comma is nonstandard" become an error.
+       X_CFLAGS="$X_CFLAGS -we271"
        X_CFLAGS="$X_CFLAGS -Werror"
        dnl  ... however, some things aren't solved, yet:
        dnl  (for the time being,) we need to disable some warnings (making 
them remarks doesn't seem to work with -Werror):
-       X_CFLAGS="$X_CFLAGS -wd1418,1419,981,810,193,111,1357"
+       X_CFLAGS="$X_CFLAGS -wd1418,1419,981,193,1357"
        dnl ICC 11 warns about non-pointer conversion from "<type>" to
        dnl "<smaller>" may lose significant bits, it does however, also for
        dnl constants like short s = 1234, which is too much
@@ -680,12 +688,11 @@
        dnl  #1418: external definition with no prior declaration
        dnl  #1419: external declaration in primary source file
        dnl  # 981: operands are evaluated in unspecified order
-       dnl  # 810: conversion from "." to "." may lose significant bits
        dnl  # 193: zero used for undefined preprocessing identifier
-       dnl  # 111: statement is unreachable
        dnl  #1357: optimization disabled due to excessive resource 
requirements; contact Intel Premier Support for assistance
        dnl  #1572: floating-point equality and inequality comparisons are 
unreliable
        dnl  #1599: declaration hides variable 
+       dnl  #2259: non-pointer conversion from "." to "." may lose significant 
bits
 
        dnl  (At least on Fedora Core 4,) bison 2.0 seems to generate code
        dnl  that icc does not like; since the problem only occurs with
diff --git a/gdk/ChangeLog.Apr2011 b/gdk/ChangeLog.Apr2011
--- a/gdk/ChangeLog.Apr2011
+++ b/gdk/ChangeLog.Apr2011
@@ -1,6 +1,10 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Sat Jul  9 2011 Sjoerd Mullender <[email protected]>
+- Fixed a problem where appending string BATs could cause enormous growth
+  of the string heap.  This fixes bug 2820.
+
 * Wed Jun 29 2011 Sjoerd Mullender <[email protected]>
 - Fixes to memory detection on FreeBSD.
 
diff --git a/gdk/gdk_colop.c b/gdk/gdk_colop.c
--- a/gdk/gdk_colop.c
+++ b/gdk/gdk_colop.c
@@ -83,11 +83,13 @@
        if ((!GDK_ELIMDOUBLES(b->vheap) || b->count == 0) &&
            !GDK_ELIMDOUBLES(n->vheap) &&
            b->vheap->hashash == n->vheap->hashash &&
+           /* if needs to be kept unique, take slow path */
            (b->key & BOUND2BTRUE) == 0 &&
+           /* if view, only copy if significant part of parent is used */
            (VIEWparent(n) == 0 ||
             CBP_cache(VIEWparent(n))->capacity < 2 * n->count)) {
                /* append string heaps */
-               toff = b->count == 0 ? 0 : b->vheap->size;
+               toff = b->count == 0 ? 0 : b->vheap->free;
                /* make sure we get alignment right */
                toff = (toff + GDK_VARALIGN - 1) & ~(GDK_VARALIGN - 1);
                assert(((toff >> GDK_VARSHIFT) << GDK_VARSHIFT) == toff);
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -706,7 +706,7 @@
        if (!lg->log || mnstr_errnr(lg->log)) {
                if (lg->log)
                        mnstr_destroy(lg->log);
-
+               lg->log = NULL;
                return 0;
        }
        while (!err && log_read_format(lg, &l)) {
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -360,7 +360,7 @@
                if (MT_mmap_cur == -1)
                        MT_mmap_cur = i;
 #ifdef MMAP_DEBUG
-               mnstr_printf(GDKerr, "#MT_mmap_new: %s fd=%d\n", path, fd);
+               mnstr_printf(GDKstdout, "#MT_mmap_new: %s fd=%d\n", path, fd);
 #endif
                strncpy(MT_mmap_tab[i].path, path, 128);
                MT_mmap_tab[i].base = base;
@@ -414,7 +414,7 @@
                                   want to drop this */
                                ret = posix_fadvise(MT_mmap_tab[victim].fd, 
0LL, MT_mmap_tab[victim].len & ~(MT_pagesize() - 1), POSIX_FADV_DONTNEED);
 #ifdef MMAP_DEBUG
-                               mnstr_printf(GDKerr,
+                               mnstr_printf(GDKstdout,
                                              "#MT_mmap_del: 
posix_fadvise(%s,fd=%d,%uMB,POSIX_FADV_DONTNEED) = %d\n",
                                              MT_mmap_tab[victim].path,
                                              MT_mmap_tab[victim].fd,
@@ -425,7 +425,7 @@
 #endif
                        ret = close(MT_mmap_tab[victim].fd);
 #ifdef MMAP_DEBUG
-                       mnstr_printf(GDKerr,
+                       mnstr_printf(GDKstdout,
                                      "#MT_mmap_del: close(%s fd=%d) = %d\n",
                                      MT_mmap_tab[victim].path,
                                      MT_mmap_tab[victim].fd,
@@ -458,7 +458,7 @@
                        if (MT_mmap_tab[i].fd >= 0) {
                                ret = posix_fadvise(MT_mmap_tab[i].fd, 0, len & 
~(MT_pagesize() - 1), advice);
 #ifdef MMAP_DEBUG
-                               mnstr_printf(GDKerr,
+                               mnstr_printf(GDKstdout,
                                              "#MT_fadvise: 
posix_fadvise(%s,fd=%d,%uMB,%d) = %d\n",
                                              MT_mmap_tab[i].path,
                                              MT_mmap_tab[i].fd,
@@ -672,8 +672,8 @@
        return (worry);
 }
 
-/* a thread informs it is goin to (preload==1) or stops (preload==-1)
-   using a range of memory */
+/* a thread informs it is going to (preload==1) or stops
+   using (preload==-1) a range of memory */
 void
 MT_mmap_inform(void *base, size_t len, int preload, int advice, int writable)
 {
@@ -697,13 +697,13 @@
        }
        (void) pthread_mutex_unlock(&MT_mmap_lock);
        if (ret) {
-               mnstr_printf(GDKerr,
-                             "#MT_mmap_inform: posix_madvise(file=%s, fd=%d, 
base=" PTRFMT ", len=" SZFMT "MB, advice=MMAP_SEQUENTIAL) = %d\n",
+               mnstr_printf(GDKstdout,
+                             "#MT_mmap_inform: posix_madvise(file=%s, fd=%d, 
base=" PTRFMT ", len=" SZFMT "MB, advice=MMAP_SEQUENTIAL) = %d (%s)\n",
                              (i >= 0 ? MT_mmap_tab[i].path : ""),
                              (i >= 0 ? MT_mmap_tab[i].fd : -1),
                              PTRFMTCAST base,
                              len >> 20,
-                             errno);
+                             errno, strerror(errno));
        }
 }
 
@@ -892,7 +892,7 @@
        int ret = munmap(p, len);
 
 #ifdef MMAP_DEBUG
-       mnstr_printf(GDKerr, "#munmap(" LLFMT "," LLFMT ",%d) = %d\n", (long 
long) p, (long long) len, ret);
+       mnstr_printf(GDKstdout, "#munmap(" LLFMT "," LLFMT ",%d) = %d\n", (long 
long) p, (long long) len, ret);
 #endif
        MT_mmap_del(p, len);
        return ret;
@@ -904,7 +904,7 @@
        int ret = msync(((char *) p) + off, len, (mode & MMAP_SYNC) ? MS_SYNC : 
((mode & MMAP_ASYNC) ? MS_ASYNC : MS_INVALIDATE));
 
 #ifdef MMAP_DEBUG
-       mnstr_printf(GDKerr,
+       mnstr_printf(GDKstdout,
                      "#msync(" LLFMT "," LLFMT ",%s) = %d\n",
                      (long long) p, (long long) len,
                      (mode & MMAP_SYNC) ? "MS_SYNC" : ((mode & MMAP_ASYNC) ? 
"MS_ASYNC" : "MS_INVALIDATE"),
@@ -921,7 +921,7 @@
        int ret = posix_madvise(p, len & ~(MT_pagesize() - 1), advice);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to