Changeset: 322e8d32687c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=322e8d32687c
Modified Files:
        sql/server/rel_schema.c
Branch: sciql
Log Message:

merged with default


diffs (truncated from 1068 to 300 lines):

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/gdk/gdk_posix.mx b/gdk/gdk_posix.mx
--- a/gdk/gdk_posix.mx
+++ b/gdk/gdk_posix.mx
@@ -598,7 +598,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;
@@ -649,7 +649,7 @@
                                /* tell the OS quite clearly that you 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,
@@ -660,7 +660,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,
@@ -693,7 +693,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,
@@ -907,8 +907,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)
 {
@@ -932,13 +932,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));
        }
 }
 
@@ -1127,7 +1127,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;
@@ -1139,7 +1139,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"),
@@ -1156,7 +1156,7 @@
        int ret = posix_madvise(p, len & ~(MT_pagesize() - 1), advice);
 
 #ifdef MMAP_DEBUG
-       mnstr_printf(GDKerr, "#posix_madvise(" PTRFMT "," SZFMT ",%d) = %d\n",
+       mnstr_printf(GDKstdout, "#posix_madvise(" PTRFMT "," SZFMT ",%d) = 
%d\n",
                      PTRFMTCAST p, len, advice, ret);
 #endif
        if (MT_fadvise(p, len, advice))
@@ -1536,7 +1536,7 @@
        }
        if (heapstatus == _HEAPBADPTR || heapstatus == _HEAPBADBEGIN || 
heapstatus == _HEAPBADNODE) {
 
-               mnstr_printf(GDKerr, "#mallinfo(): heap is corrupt.");
+               mnstr_printf(GDKstdout, "#mallinfo(): heap is corrupt.");
        }
        _heapmin();
        return _ret;
@@ -1733,7 +1733,7 @@
                /* it could be the <expletive deleted> indexing
                 * service which prevents us from doing what we have a
                 * right to do, so try again (once) */
-               IODEBUG THRprintf(GDKout, "#retry rename %s %s\n", old, new);
+               IODEBUG THRprintf(GDKstdout, "#retry rename %s %s\n", old, new);
                MT_sleep_ms(100);       /* wait a little */
                ret = rename(old, new);
        }
@@ -2018,7 +2018,7 @@
        p = (void *) VirtualAlloc(a, size, MEM_COMMIT | mode, PAGE_READWRITE);
        (void) pthread_mutex_unlock(&MT_mmap_lock);
        if (p == NULL) {
-               mnstr_printf(GDKerr, "#VirtualAlloc(" PTRFMT "," SZFMT 
",MEM_COMMIT,PAGE_READWRITE): failed\n", PTRFMTCAST a, size);
+               mnstr_printf(GDKstdout, "#VirtualAlloc(" PTRFMT "," SZFMT 
",MEM_COMMIT,PAGE_READWRITE): failed\n", PTRFMTCAST a, size);
        }
        return p;
 }
@@ -2028,9 +2028,9 @@
 MT_vmfree(void *p, size_t size)
 {
        if (VirtualFree(p, size, MEM_DECOMMIT) == 0)
-               mnstr_printf(GDKerr, "#VirtualFree(" PTRFMT "," SZFMT 
",MEM_DECOMMIT): failed\n", PTRFMTCAST p, size);
+               mnstr_printf(GDKstdout, "#VirtualFree(" PTRFMT "," SZFMT 
",MEM_DECOMMIT): failed\n", PTRFMTCAST p, size);
        if (VirtualFree(p, 0, MEM_RELEASE) == 0)
-               mnstr_printf(GDKerr, "#VirtualFree(" PTRFMT ",0,MEM_RELEASE): 
failed\n", PTRFMTCAST p);
+               mnstr_printf(GDKstdout, "#VirtualFree(" PTRFMT 
",0,MEM_RELEASE): failed\n", PTRFMTCAST p);
 }
 
 void *
@@ -2051,7 +2051,7 @@
                size_t ret = VirtualFree(p + newsize, oldsize - newsize, 
MEM_DECOMMIT);
 
                if (ret == 0)
-                       mnstr_printf(GDKerr, "#VirtualFree(" PTRFMT "," SSZFMT 
",MEM_DECOMMIT): failed\n", PTRFMTCAST(p + newsize), (ssize_t) (oldsize - 
newsize));
+                       mnstr_printf(GDKstdout, "#VirtualFree(" PTRFMT "," 
SSZFMT ",MEM_DECOMMIT): failed\n", PTRFMTCAST(p + newsize), (ssize_t) (oldsize 
- newsize));
        } else if (oldsize < newsize) {
                (void) pthread_mutex_lock(&MT_mmap_lock);
                a = (char *) VirtualAlloc(p, newsize, MEM_COMMIT, 
PAGE_READWRITE);
diff --git a/gdk/gdk_relop.mx b/gdk/gdk_relop.mx
--- a/gdk/gdk_relop.mx
+++ b/gdk/gdk_relop.mx
@@ -1497,7 +1497,8 @@
        JOINPROPCHK {
                if (b) {
                        BATpropcheck(b, BATPROPS_QUICK);
-                       BATpropcheck(BATmirror(b), BATPROPS_QUICK);
+                       if (b->H != b->T)
+                               BATpropcheck(BATmirror(b), BATPROPS_QUICK);
                }
        }
 
@@ -1516,8 +1517,11 @@
         * Disable via command line option  --debug=16777216
         */
        JOINPROPCHK {
-               if (b)
-                       BATpropcheck(BATmirror(b), BATPROPS_QUICK);
+               if (b) {
+                       BATpropcheck(b, BATPROPS_QUICK);
+                       if (b->H != b->T)
+                               BATpropcheck(BATmirror(b), BATPROPS_QUICK);
+               }
        }
        return b;
 }
diff --git a/gdk/gdk_storage.mx b/gdk/gdk_storage.mx
--- a/gdk/gdk_storage.mx
+++ b/gdk/gdk_storage.mx
@@ -1116,42 +1116,41 @@
                c->len = (*c->format) (&c->buf, &c->size, v);
 }
 
-@= print_head
-       str buf = @1 ? argv[@2].tpe : argv[@2].buf; /* contains column title */
-       int len = (int) strlen(buf);
-
-       if (mnstr_write(s, buf, len, 1) != 1)
-               return -1;
-       TABS(s, argv[@2].tabs - ((@1 + len - 1) / 8));
-       if (mnstr_errnr(s))
-               return -1;
-@= print_header
-       k = 1;
-       if (mnstr_write(s, "# ", 2, 1) != 1)
-               return -1;
-       if (argv[0].format) {
-               @:print_head(@1,0)@
-       }
-       for (;;) {
-               @:print_head(@1,k)@
-               if (k++ >= argc)
-                       break;
-       }
-       if (@1) {
-               if (mnstr_printf(s, "  # type\n") < 0)
-                       return -1;
-       } else {
-               if (mnstr_printf(s, "  # name\n") < 0)
-                       return -1;
-       }
-@c
 static int
 print_header(int argc, col_format_t *argv, stream *s)
 {
        int k;
+       str buf;
+       int len;
 
-       @:print_header(0)@
-       @:print_header(2)@
+       if (mnstr_write(s, "# ", 2, 1) != 1)
+               return -1;
+       for (k = argv[0].format ? 0 : 1; k <= argc; k++) {
+               buf = argv[k].buf; /* contains column title */
+               len = (int) strlen(buf);
+
+               if (mnstr_write(s, buf, len, 1) != 1)
+                       return -1;
+               TABS(s, argv[k].tabs - ((0 + len - 1) / 8));
+               if (mnstr_errnr(s))
+                       return -1;
+       }
+       if (mnstr_printf(s, "  # name\n") < 0)
+               return -1;
+       if (mnstr_write(s, "# ", 2, 1) != 1)
+               return -1;
+       for (k = argv[0].format ? 0 : 1; k <= argc; k++) {
+               buf = argv[k].tpe; /* contains column title */
+               len = (int) strlen(buf);
+
+               if (mnstr_write(s, buf, len, 1) != 1)
+                       return -1;
+               TABS(s, argv[k].tabs - ((2 + len - 1) / 8));
+               if (mnstr_errnr(s))
+                       return -1;
+       }
+       if (mnstr_printf(s, "  # type\n") < 0)
+               return -1;
        return 0;
 }
 
diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -1427,7 +1427,7 @@
                GDKmemfail("GDKmmap", len, 0, BBPTRIM_ALL);
                ret = MT_mmap(path, mode, off, len);
                if (ret != (void *) -1L) {
-                       THRprintf(GDKout, "#GDKmmap: recovery ok. 
Continuing..\n");
+                       THRprintf(GDKstdout, "#GDKmmap: recovery ok. 
Continuing..\n");
                }
        }
        ALLOCDEBUG fprintf(stderr, "#GDKmmap " LLFMT " " SZFMT " " PTRFMT "\n", 
(lng) off, len, PTRFMTCAST ret);
@@ -1477,7 +1477,7 @@
                        MT_alloc_print();
                        GDKfatal("GDKvmalloc: failed for " SZFMT " bytes", 
size);
                } else {
-                       THRprintf(GDKout, "#GDKvmalloc(" SZFMT "): recovery ok. 
Continuing..\n", size);
+                       THRprintf(GDKstdout, "#GDKvmalloc(" SZFMT "): recovery 
ok. Continuing..\n", size);
                }
        }
        ALLOCDEBUG fprintf(stderr, "#GDKvmalloc " SZFMT " " SZFMT " " PTRFMT 
"\n", size, *maxsize, PTRFMTCAST ret);
@@ -1504,7 +1504,7 @@
                        MT_alloc_print();
                        GDKfatal("GDKvmrealloc: failed for " SZFMT " bytes 
(from " SZFMT ")", newsize, oldsize);
                } else {
-                       THRprintf(GDKout, "#GDKvmrealloc(" SZFMT "): recovery 
ok. Continuing..\n", newsize);
+                       THRprintf(GDKstdout, "#GDKvmrealloc(" SZFMT "): 
recovery ok. Continuing..\n", newsize);
                }
        }
        ALLOCDEBUG fprintf(stderr, "#GDKvmrealloc " SZFMT " " SZFMT " " PTRFMT 
" " PTRFMT "\n", newsize, *newmax, PTRFMTCAST pold, PTRFMTCAST ret);
diff --git a/java/ChangeLog.Apr2011 b/java/ChangeLog.Apr2011
--- a/java/ChangeLog.Apr2011
+++ b/java/ChangeLog.Apr2011
@@ -1,6 +1,11 @@
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to