Changeset: c7d68a128d16 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c7d68a128d16
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
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_aggr.c
gdk/gdk_utils.c
monetdb5/modules/mal/mal_mapi.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
tools/merovingian/daemon/argvcmds.c
tools/merovingian/daemon/client.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/discoveryrunner.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/mserver/Makefile.ag
Branch: linear-hashing
Log Message:
Merge with default branch.
diffs (truncated from 1054 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
@@ -313,7 +313,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);
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
@@ -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) {
+ if (lseek(fd, 4, SEEK_SET) >= 0 &&
+ lockf(fd, mode, 1) == 0) {
if (mode == F_ULOCK || mode == F_TEST) {
close(fd);
return 0;
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -67,7 +67,7 @@ mutils_export char *dirname(char *path);
#define F_ULOCK 0 /* unlock a previously locked region */
#define F_LOCK 1 /* lock a region for exclusive use */
-mutils_export int MT_lockf(char *filename, int mode, off_t off, off_t len);
+mutils_export int MT_lockf(char *filename, int mode);
mutils_export void print_trace(void);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -134,20 +134,22 @@ AS_CASE([$CC],
AS_IF([test -f "$srcdir"/vertoo.data],
[
# Developers compiling from Mercurial:
- # default is --enable-strict --enable-assert --enable-debug
--disable-optimize --enable-developer
+ # default is --enable-strict --enable-assert --enable-debug
--disable-optimize --enable-developer --enable-profiler=auto
dft_strict=yes
dft_assert=yes
dft_debug=yes
dft_optimize=no
- dft_developer=yes],
+ dft_developer=yes
+ dft_profiler=auto],
[
# Users compiling from source tarball(s):
- # default is --disable-strict --disable-assert --disable-debug
--disable-optimize --disable-developer
+ # default is --disable-strict --disable-assert --disable-debug
--disable-optimize --disable-developer --disable-profiler
dft_strict=no
dft_assert=no
dft_debug=no
dft_optimize=auto
- dft_developer=no])
+ dft_developer=no
+ dft_profiler=no])
AC_ARG_ENABLE([developer],
[AS_HELP_STRING([--enable-developer],
@@ -293,6 +295,14 @@ AC_ARG_ENABLE([strict],
[enable_strict=$enableval],
[enable_strict=$dft_strict])
+# when optimizing, don't enable the profiler (unless it's explicitly enabled)
+AS_VAR_IF([enable_optimize], [yes], [dft_profiler=no])
+AC_ARG_ENABLE([profiler],
+ [AS_HELP_STRING([--enable-profiler],
+ [add support for the Google profiler library (default=auto for
development sources)])],
+ [enable_profiler=$enableval],
+ [enable_profiler=$dft_profiler])
+
dft_sanitizer=no
AC_ARG_ENABLE([sanitizer],
[AS_HELP_STRING([--enable-sanitizer],
@@ -2168,6 +2178,19 @@ AC_SUBST([LIBLAS_LIBS])
AM_CONDITIONAL([HAVE_LIDAR], [test "x$have_lidar" = xyes -o "x$have_lidar" =
xauto])
+dnl check for profiler library
+AS_CASE([$enable_profiler],
+ [no], [have_profiler=no],
+ [
+ PKG_CHECK_MODULES([PROFILER], [libprofiler],
+ [have_profiler=yes],
+ [have_profiler=no; why_not_profiler="(profiler library
not found)"])
+ AS_VAR_IF([have_profiler], [yes], [
+ AC_DEFINE([HAVE_LIBPROFILER], 1, [Define if you have
the profiler library])
+ AC_SUBST([PKG_PROFILER], [libprofiler])])])
+AM_CONDITIONAL([HAVE_LIBPROFILER], [test x$have_profiler != xno])
+
+
# checks for header files
AC_HEADER_STDBOOL
# NOTE: these header files are in alphabetical order to ease maintenance
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,29 +1,29 @@
debian/tmp/usr/bin/mserver5 usr/bin
debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT:
lib_{bam,fits,geom,gsl,lidar,pyapi*,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT:
lib_{bam,fits,geom,gsl,lidar,opt_sql_append,pyapi*,rapi,sql}.so
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so
usr/lib/x86_64-linux-gnu/monetdb5
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_opt_sql_append.so
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so
usr/lib/x86_64-linux-gnu/monetdb5
-# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT:
{bam,fits,geom,gsl,lidar,pyapi,rapi,sql*,*_hge}.mal
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfglprsu]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
+# usr/lib/x86_64-linux-gnu/monetdb5/*.mal EXCEPT:
{bam,fits,geom,gsl,lidar,opt_sql_appendpyapi,rapi,sql*,*_hge}.mal
+debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/[!bfgloprsu]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/ba[!m]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/b[!a]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/f[!i]*.mal
usr/lib/x86_64-linux-gnu/monetdb5
debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/generator.mal
usr/lib/x86_64-linux-gnu/monetdb5
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list