Changeset: a65d4eb8731b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a65d4eb8731b
Added Files:
        monetdb5/mal/Tests/tst180.malC
        monetdb5/mal/Tests/tst180.stable.err
        monetdb5/mal/Tests/tst180.stable.out
        sql/test/BugTracker-2020/Tests/All
        sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.sql
        sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.stable.err
        sql/test/BugTracker-2020/Tests/median_avg-nulls.Bug-6807.stable.out
Modified Files:
        MonetDB.spec
        NT/mksqlwxs.py
        clients/Tests/exports.stable.out
        clients/mapiclient/mclient.c
        common/stream/stream.c
        common/utils/msabaoth.c
        common/utils/mutils.c
        common/utils/mutils.h
        configure.ag
        debian/monetdb5-server.install
        debian/rules
        gdk/gdk.h
        gdk/gdk_aggr.c
        gdk/gdk_bat.c
        gdk/gdk_batop.c
        gdk/gdk_bbp.c
        gdk/gdk_calc.c
        gdk/gdk_group.c
        gdk/gdk_hash.c
        gdk/gdk_hash.h
        gdk/gdk_heap.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
        gdk/gdk_orderidx.c
        gdk/gdk_private.h
        gdk/gdk_project.c
        gdk/gdk_select.c
        gdk/gdk_storage.c
        gdk/gdk_unique.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_authorize.c
        monetdb5/mal/mal_builder.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_resource.h
        monetdb5/mal/mal_session.c
        monetdb5/mal/mal_stack.c
        monetdb5/mal/mal_stack.h
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/kernel/status.c
        monetdb5/modules/mal/mal_mapi.c
        monetdb5/modules/mal/tokenizer.c
        monetdb5/optimizer/opt_evaluate.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_gencode.c
        sql/storage/bat/bat_storage.c
        sql/storage/store.c
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/argvcmds.c
        tools/merovingian/daemon/client.c
        tools/merovingian/daemon/connections.c
        tools/merovingian/daemon/controlrunner.c
        tools/merovingian/daemon/discoveryrunner.c
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/daemon/handlers.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/multiplex-funnel.c
        tools/merovingian/utils/control.c
        tools/merovingian/utils/glob.c
        tools/mserver/Makefile.ag
Branch: gdk_tracer
Log Message:

merged with default


diffs (truncated from 5020 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -680,7 +680,6 @@ exit 0
 %endif
 %{_libdir}/monetdb5/lib_capi.so
 %{_libdir}/monetdb5/lib_generator.so
-%{_libdir}/monetdb5/lib_opt_sql_append.so
 %{_libdir}/monetdb5/lib_udf.so
 %doc %{_mandir}/man1/mserver5.1.gz
 %dir %{_datadir}/doc/MonetDB
@@ -967,6 +966,7 @@ export CFLAGS
        --enable-mapi=yes \
        --enable-netcdf=no \
        --enable-odbc=yes \
+       --enable-profiler=no \
        
--enable-py2integration=%{?with_py2integration:yes}%{!?with_py2integration:no} \
        
--enable-py3integration=%{?with_py3integration:yes}%{!?with_py3integration:no} \
        
--enable-rintegration=%{?with_rintegration:yes}%{!?with_rintegration:no} \
@@ -1040,6 +1040,9 @@ install -d -m 0775 %{buildroot}%{_locals
 # .la files
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/*.la
+rm -f %{buildroot}%{_libdir}/monetdb5/opt_sql_append.mal
+rm -f %{buildroot}%{_libdir}/monetdb5/lib_opt_sql_append.so
+rm -f %{buildroot}%{_libdir}/monetdb5/autoload/??_opt_sql_append.mal
 
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7
 for selinuxvariant in %{selinux_variants}
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -178,7 +178,7 @@ def main():
     print(r'              <Directory Id="monetdb5" Name="monetdb5">')
     print(r'                <Directory Id="autoload" Name="autoload">')
     id = comp(features, id, 18,
-              [r'lib\monetdb5\autoload\{}'.format(x) for x in 
sorted(filter(lambda x: x.endswith('.mal') and ('geom' not in x) and ('pyapi' 
not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5', 
'autoload'))))])
+              [r'lib\monetdb5\autoload\{}'.format(x) for x in 
sorted(filter(lambda x: x.endswith('.mal') and ('geom' not in x) and ('pyapi' 
not in x) and ('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 
'lib', 'monetdb5', 'autoload'))))])
     id = comp(geom, id, 18,
               [r'lib\monetdb5\autoload\{}'.format(x) for x in 
sorted(filter(lambda x: x.endswith('.mal') and ('geom' in x), 
os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5', 'autoload'))))])
     id = comp(pyapi2, id, 18,
@@ -193,11 +193,11 @@ def main():
               [r'lib\monetdb5\createdb\{}'.format(x) for x in 
sorted(filter(lambda x: x.endswith('.sql') and ('geom' in x), 
os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5', 'createdb'))))])
     print(r'                </Directory>')
     id = comp(features, id, 16,
-              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.endswith('.mal') and ('geom' not in x) and ('pyapi' not in x), 
os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5'))))])
+              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.endswith('.mal') and ('geom' not in x) and ('pyapi' not in x) and 
('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 
'monetdb5'))))])
     id = comp(features, id, 16,
-              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('lib_') and x.endswith('.dll') and ('geom' not in x) and ('pyapi' 
not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5'))))])
+              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('lib_') and x.endswith('.dll') and ('geom' not in x) and ('pyapi' 
not in x) and ('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 
'lib', 'monetdb5'))))])
     id = comp(debug, id, 16,
-              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('lib_') and x.endswith('.pdb') and ('geom' not in x), 
os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5'))))])
+              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('lib_') and x.endswith('.pdb') and ('geom' not in x) and 
('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 
'monetdb5'))))])
     id = comp(geom, id, 16,
               [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.endswith('.mal') and ('geom' in x), os.listdir(os.path.join(sys.argv[3], 
'lib', 'monetdb5'))))])
     id = comp(geom, id, 16,
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
@@ -308,6 +308,7 @@ const char *GDKversion(void);
 size_t GDKvm_cursize(void);
 void *GDKzalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__alloc_size__(1))) __attribute__((__warn_unused_result__));
 void HASHdestroy(BAT *b);
+gdk_return HASHgrowbucket(BAT *b);
 BUN HASHlist(Hash *h, BUN i);
 BUN HASHprobe(const Hash *h, const void *v);
 void HEAP_free(Heap *heap, var_t block);
@@ -326,7 +327,7 @@ MT_Id MT_getpid(void);
 size_t MT_getrss(void);
 void MT_init(void);
 int MT_join_thread(MT_Id t);
-int MT_lockf(char *filename, int mode, off_t off, off_t len);
+int MT_lockf(char *filename, int mode);
 void *MT_mmap(const char *path, int mode, size_t len);
 int MT_munmap(void *p, size_t len);
 bool MT_path_absolute(const char *path);
@@ -2076,7 +2077,6 @@ int chkInstruction(Module s, MalBlkPtr m
 str chkProgram(Module s, MalBlkPtr mb);
 str chkTypes(Module s, MalBlkPtr mb, int silent);
 str cleanupTraces(Client cntxt);
-void clearStack(MalStkPtr s);
 void clearTrace(Client cntxt);
 void clearVariable(MalBlkPtr mb, int varid);
 str clear_tableRef;
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -124,6 +124,8 @@ static timertype t0, t1;    /* used for tim
 
 #ifdef HAVE_POPEN
 static char *pager = 0;                /* use external pager */
+#endif
+#ifdef HAVE_SIGACTION
 #include <signal.h>            /* to block SIGPIPE */
 #endif
 static int rowsperpage = 0;    /* for SQL pagination */
@@ -1808,36 +1810,27 @@ start_pager(stream **saveFD)
 
        if (pager) {
                FILE *p;
-               struct sigaction act;
 
-               /* ignore SIGPIPE so that we get an error instead of signal */
-               act.sa_handler = SIG_IGN;
-               (void) sigemptyset(&act.sa_mask);
-               act.sa_flags = 0;
-               if(sigaction(SIGPIPE, &act, NULL) == -1) {
+               p = popen(pager, "w");
+               if (p == NULL)
                        fprintf(stderr, "Starting '%s' failed\n", pager);
-               } else {
-                       p = popen(pager, "w");
-                       if (p == NULL)
+               else {
+                       *saveFD = toConsole;
+                       /* put | in name to indicate that file should be closed 
with pclose */
+                       if ((toConsole = file_wastream(p, "|pager")) == NULL) {
+                               toConsole = *saveFD;
+                               *saveFD = NULL;
                                fprintf(stderr, "Starting '%s' failed\n", 
pager);
-                       else {
-                               *saveFD = toConsole;
-                               /* put | in name to indicate that file should 
be closed with pclose */
-                               if ((toConsole = file_wastream(p, "|pager")) == 
NULL) {
+                       }
+#ifdef HAVE_ICONV
+                       if (encoding != NULL) {
+                               if ((toConsole = iconv_wstream(toConsole, 
encoding, "pager")) == NULL) {
                                        toConsole = *saveFD;
                                        *saveFD = NULL;
                                        fprintf(stderr, "Starting '%s' 
failed\n", pager);
                                }
-#ifdef HAVE_ICONV
-                               if (encoding != NULL) {
-                                       if ((toConsole = 
iconv_wstream(toConsole, encoding, "pager")) == NULL) {
-                                               toConsole = *saveFD;
-                                               *saveFD = NULL;
-                                               fprintf(stderr, "Starting '%s' 
failed\n", pager);
-                                       }
-                               }
+                       }
 #endif
-                       }
                }
        }
 }
@@ -3336,6 +3329,16 @@ main(int argc, char **argv)
                exit(2);
        }
 #endif
+#ifdef HAVE_SIGACTION
+       struct sigaction act;
+       /* ignore SIGPIPE so that we get an error instead of signal */
+       act.sa_handler = SIG_IGN;
+       (void) sigemptyset(&act.sa_mask);
+       act.sa_flags = 0;
+       if (sigaction(SIGPIPE, &act, NULL) == -1)
+               perror("sigaction");
+#endif
+
        toConsole = stdout_stream = file_wastream(stdout, "stdout");
        stderr_stream = file_wastream(stderr, "stderr");
        if(!stdout_stream || !stderr_stream) {
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2500,6 +2500,8 @@ socket_read(stream *restrict s, void *re
                                               .events = POLLIN};
 
                        ret = poll(&pfd, 1, (int) s->timeout);
+                       if (ret == -1 && errno == EINTR)
+                               continue;
                        if (ret == -1 || (pfd.revents & POLLERR)) {
                                s->errnr = MNSTR_READ_ERROR;
                                return -1;
@@ -2550,6 +2552,8 @@ socket_read(stream *restrict s, void *re
                }
 #else
                nr = read(s->stream_data.s, buf, size);
+               if (nr == -1 && errno == EINTR)
+                       continue;
                if (nr == -1) {
                        s->errnr = MNSTR_READ_ERROR;
                        return -1;
@@ -2643,6 +2647,8 @@ socket_isalive(stream *s)
        pfd = (struct pollfd){.fd = fd};
        if ((ret = poll(&pfd, 1, 0)) == 0)
                return 1;
+       if (ret == -1 && errno == EINTR)
+               return socket_isalive(s);
        if (ret < 0 || pfd.revents & (POLLERR | POLLHUP))
                return 0;
        assert(0);              /* unexpected revents value */
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -148,7 +148,7 @@ msab_init(const char *dbfarm, const char
        if (_sabaoth_internal_dbname != NULL)
                free(_sabaoth_internal_dbname);
 
-       /* this UUID is supposed to be unique per-process, we use it lateron
+       /* this UUID is supposed to be unique per-process, we use it later on
         * to determine if a database is (started by) the current process,
         * since locking always succeeds for the same process */
        if (_sabaoth_internal_uuid == NULL)
@@ -641,7 +641,7 @@ msab_getSingleStatus(const char *pathbuf
                        (void)fclose(f);
                }
        } else if ((snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
".gdk_lock") > 0) & /* no typo */
-                          ((fd = MT_lockf(buf, F_TEST, 4, 1)) == -2)) {
+                          ((fd = MT_lockf(buf, F_TEST)) == -2)) {
                /* Locking failed; this can be because the lockfile couldn't
                 * be created.  Probably there is no Mserver running for
                 * that case also.
diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -278,7 +278,7 @@ dirname(char *path)
 
 /* see contract of unix MT_lockf */
 int
-MT_lockf(char *filename, int mode, off_t off, off_t len)
+MT_lockf(char *filename, int mode)
 {
        int ret = 1, fd = -1;
        OVERLAPPED ov;
@@ -292,19 +292,11 @@ MT_lockf(char *filename, int mode, off_t
 
        ov = (OVERLAPPED) {0};
 #if defined(DUMMYSTRUCTNAME) && (defined(NONAMELESSUNION) || 
!defined(_MSC_EXTENSIONS))        /* Windows SDK v7.0 */
-       ov.u.s.Offset = (unsigned int) off;
-#if 0
-       ov.u.s.OffsetHigh = off >> 32;
-#else
-       ov.u.s.OffsetHigh = 0;  /* sizeof(off) == 4, i.e. off >> 32 is not 
possible */
-#endif
+       ov.u.s.Offset = 4;
+       ov.u.s.OffsetHigh = 0;
 #else
-       ov.Offset = (unsigned int) off;
-#if 0
-       ov.OffsetHigh = off >> 32;
-#else
-       ov.OffsetHigh = 0;      /* sizeof(off) == 4, i.e. off >> 32 is not 
possible */
-#endif
+       ov.Offset = 4;
+       ov.OffsetHigh = 0;
 #endif
 
        if (mode == F_ULOCK) {
@@ -316,7 +308,7 @@ MT_lockf(char *filename, int mode, off_t
                                fp = *fpp;
                                *fpp = fp->next;
                                free(fp);
-                               ret = UnlockFileEx(fh, 0, len, 0, &ov);
+                               ret = UnlockFileEx(fh, 0, 1, 0, &ov);
                                return ret ? 0 : -1;
                        }
                }
@@ -327,7 +319,7 @@ MT_lockf(char *filename, int mode, off_t
                                NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
                if (fh == INVALID_HANDLE_VALUE)
                        return -2;
-               ret = UnlockFileEx(fh, 0, len, 0, &ov);
+               ret = UnlockFileEx(fh, 0, 1, 0, &ov);
                CloseHandle(fh);
                return 0;
        }
@@ -342,13 +334,13 @@ MT_lockf(char *filename, int mode, off_t
        }
 
        if (mode == F_TLOCK) {
-               ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
+               ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ov);
        } else if (mode == F_LOCK) {
-               ret = LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
+               ret = LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ov);
        } else if (mode == F_TEST) {
-               ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, len, 0, &ov);
+               ret = LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY | 
LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ov);
                if (ret != 0) {
-                       UnlockFileEx(fh, 0, len, 0, &ov);
+                       UnlockFileEx(fh, 0, 1, 0, &ov);
                        close(fd);
                        return 0;
                }
@@ -408,15 +400,15 @@ lockf(int fd, int cmd, off_t len)
  * returns the (open) file descriptor to the file when locking
  * returns 0 when unlocking */
 int
-MT_lockf(char *filename, int mode, off_t off, off_t len)
+MT_lockf(char *filename, int mode)
 {
        int fd = open(filename, O_CREAT | O_RDWR | O_TEXT | O_CLOEXEC, 
MONETDB_MODE);
 
        if (fd < 0)
                return -2;
 
-       if (lseek(fd, off, SEEK_SET) >= 0 &&
-           lockf(fd, mode, len) == 0) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to