Changeset: b1556f21a4fa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b1556f21a4fa
Modified Files:
        gdk/gdk_batop.c
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Mar2025 branch.


diffs (166 lines):

diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -69,12 +69,6 @@ connect_socket_unix(Mapi mid)
        return mapi_setError(mid, "Unix domain sockets not supported", 
__func__, MERROR);
 }
 
-static MapiMsg
-scan_unix_sockets(Mapi mid)
-{
-       return mapi_setError(mid, "Unix domain sockets not supported", 
__func__, MERROR);
-}
-
 #endif
 
 
@@ -90,8 +84,9 @@ mapi_reconnect(Mapi mid)
                return MERROR;
        }
 
-       // If neither host nor port are given, scan the Unix domain sockets in
-       // /tmp and see if any of them serve this database.
+       // If neither host nor port are given, scan all Unix domain sockets
+       // and then all 'localhost' TCP sockets to see if any of them
+       // serve this database.
        // Otherwise, just try to connect to what was given.
        if (msettings_connect_scan(mid->settings))
                return scan_sockets(mid);
@@ -104,13 +99,17 @@ scan_sockets(Mapi mid)
 {
        msettings_error errmsg;
 
+       // If we support Unix domain sockets, scan them first
+#ifdef HAVE_SYS_UN_H
        if (scan_unix_sockets(mid) == MOK)
                return MOK;
        /* if database was not unknown (no message "no such database"),
         * skip further attempts to connect */
        if (mid->errorstr && strstr(mid->errorstr, "no such database") == NULL)
                return MERROR;
+#endif
 
+       // If that didn't succeed, force the connection to TCP 'localhost'.
        errmsg = msetting_set_string(mid->settings, MP_HOST, "localhost");
        if (!errmsg)
                errmsg = msettings_validate(mid->settings);
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -946,6 +946,26 @@ BATappend2(BAT *b, BAT *n, BAT *s, bool 
                int xx = ATOMcmp(b->ttype,
                                 BUNtail(ni, ci.seq - hseq),
                                 BUNtail(bi, last));
+               if (b->tsorted && !ni.sorted && ni.nosorted == 0 && xx >= 0) {
+                       /* b is currently sorted; we don't know whether
+                        * n is sorted; first value of n is at least as
+                        * large as last value of b: we invest in an
+                        * order check of n to see whether the result is
+                        * still sorted */
+                       (void) BATordered(n);
+                       bat_iterator_end(&ni);
+                       ni = bat_iterator(n);
+               }
+               if (b->trevsorted && !ni.revsorted && ni.norevsorted == 0 && xx 
<= 0) {
+                       /* b is currently reverse sorted; we don't know
+                        * whether n is reverse sorted; first value of n
+                        * is at most as large as last value of b: we
+                        * invest in an order check of n to see whether
+                        * the result is still reverse sorted */
+                       (void) BATordered_rev(n);
+                       bat_iterator_end(&ni);
+                       ni = bat_iterator(n);
+               }
                if (b->tsorted && (!ni.sorted || xx < 0)) {
                        b->tsorted = false;
                        b->tnosorted = 0;
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -321,8 +321,8 @@ MSscheduleClient(str command, str peer, 
                        cleanUpScheduleClient(c, &command, &msg);
                        return;
                }
-               if (strncasecmp("sql", lang, 3) != 0
-                       && strncasecmp("msql", lang, 3) != 0
+               if (strncasecmp("sql", lang, strlen(lang)) != 0
+                       && strncasecmp("msql", lang, strlen(lang)) != 0
                        && strcmp(user, "monetdb") != 0) {
                        mnstr_printf(fout,
                                                 "!only the 'monetdb' user can 
use non-sql languages. "
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -4129,34 +4129,49 @@ def main(argv) :
                 testdirs = [d for (prio, d) in sorted(td)]
                 if verbosity > 1:
                     print('\nRunning all tests in directories %s.\n' % 
str(testdirs))
-                with 
concurrent.futures.ThreadPoolExecutor(max_workers=opts.parallel) as tp:
-                    try:
+                tp = None
+                try:
+                    if opts.parallel > 1 and len(testdirs) > 1:
+                        tp = 
concurrent.futures.ThreadPoolExecutor(max_workers=opts.parallel)
                         futures = {tp.submit(PerformDir, env, d, [], 
test_count): d for d in testdirs}
-                        for future in concurrent.futures.as_completed(futures):
+                        iter = concurrent.futures.as_completed(futures)
+                    else:
+                        iter = testdirs
+                    for d in iter:
+                        if tp is not None:
+                            future = d
                             d = futures[future]
                             elem, diff, interrupted = future.result()
-                            if elem is not None:
-                                if diff <= F_OK:
-                                    body_good.append(elem)
-                                else:
-                                    body_bad.append(elem)
-                            if not errseen and diff > F_WARN:
-                                errseen = True
-                            if interrupted:
+                        else:
+                            elem, diff, interrupted = PerformDir(env, d, [], 
test_count)
+                        if elem is not None:
+                            if diff <= F_OK:
+                                body_good.append(elem)
+                            else:
+                                body_bad.append(elem)
+                        if not errseen and diff > F_WARN:
+                            errseen = True
+                        if interrupted:
+                            break
+                        if not testweb:
+                            if global_timeout and start_time + global_timeout 
< time.time():
+                                print('\nGlobal testing timeout reached\n')
                                 break
-                            if not testweb:
-                                if global_timeout and start_time + 
global_timeout < time.time():
-                                    print('\nGlobal testing timeout reached\n')
-                                    break
-                                if produce_html:
-                                    # after a directory has been tested, create
-                                    # the index file so that we can look at 
test
-                                    # results while the tests are running
-                                    body = body_bad + body_good
-                                    CreateHtmlIndex(env, '', 
os.path.join(TSTTRGBASE, TSTPREF), F_SKIP, F_SKIP, *body)
-                    except KeyboardInterrupt:
+                            if produce_html:
+                                # after a directory has been tested, create
+                                # the index file so that we can look at test
+                                # results while the tests are running
+                                body = body_bad + body_good
+                                CreateHtmlIndex(env, '', 
os.path.join(TSTTRGBASE, TSTPREF), F_SKIP, F_SKIP, *body)
+                except KeyboardInterrupt:
+                    if tp is not None:
                         tp.shutdown(cancel_futures=True)
-                        raise
+                        tp = None
+                    raise
+                finally:
+                    if tp is not None:
+                        tp.shutdown(wait=True)
+                        tp = None
             if verbosity == 0:
                 print()
         except KeyboardInterrupt:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to