Changeset: aa26087ebc8f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aa26087ebc8f
Modified Files:
        sql/server/rel_optimize_sel.c
        testing/Mtest.py.in
        testing/sqllogictest.py
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 2515 to 300 lines):

diff --git a/sql/server/rel_optimize_sel.c b/sql/server/rel_optimize_sel.c
--- a/sql/server/rel_optimize_sel.c
+++ b/sql/server/rel_optimize_sel.c
@@ -2295,7 +2295,7 @@ find_fk( mvc *sql, list *rels, list *exp
 }
 
 static int
-rels_find_one_rel( sql_rel **rels, int nr, sql_exp *e)
+exp_find_one_rel( sql_rel **rels, int nr, sql_exp *e)
 {
        int fnd = 0;
 
@@ -2309,6 +2309,22 @@ rels_find_one_rel( sql_rel **rels, int n
        return fnd;
 }
 
+static int
+exps_find_one_rel( sql_rel **rels, int nr, list *exps)
+{
+       int fnd = 0;
+
+       for(node *n = exps->h; n; n = n->next) {
+               int nfnd = exp_find_one_rel(rels, nr, n->data);
+               if (nfnd != fnd && fnd)
+                       return 0;
+               fnd = nfnd;
+               if (!fnd)
+                       return 0;
+       }
+       return fnd;
+}
+
 /* TODO move popcount and popcount64 into gdk_*.h, used in gdk_cand, strimps 
and here */
 static inline int
 popcount64(uint64_t x)
@@ -2382,18 +2398,16 @@ order_joins(visitor *v, list *rels, list
 
                h[ci] = r1[ci] = r2[ci] = 0;
                r3[ci] = 0;
-               /* h[ci] = exp_find_rels(cje, rels) */
-               if (cje->type != e_cmp || !is_complex_exp(cje->flag) || 
!find_prop(cje->p, PROP_HASHCOL) ||
-                  (cje->type == e_cmp && cje->f == NULL)) {
+               if (cje->type == e_cmp) {
                        cje->tmp = ci;
-                       r1[ci] = rels_find_one_rel(rels_a, nr_rels, cje->l);
-                       r2[ci] = rels_find_one_rel(rels_a, nr_rels, cje->r);
+                       r1[ci] = cje->flag == cmp_filter ? 
exps_find_one_rel(rels_a, nr_rels, cje->l) : exp_find_one_rel(rels_a, nr_rels, 
cje->l);
+                       r2[ci] = cje->flag == cmp_filter ? 
exps_find_one_rel(rels_a, nr_rels, cje->r) : exp_find_one_rel(rels_a, nr_rels, 
cje->r);
                        if (r1[ci])
                                h[ci] |= ((ulng)1)<<((r1[ci]-1)%64);
                        if (r2[ci])
                                h[ci] |= ((ulng)1)<<((r2[ci]-1)%64);
-                       if (cje->f) {
-                               r3[ci] = rels_find_one_rel(rels_a, nr_rels, 
cje->f);
+                       if (cje->f && cje->flag != cmp_filter) {
+                               r3[ci] = exp_find_one_rel(rels_a, nr_rels, 
cje->f);
                                if (r3[ci] == r2[ci])
                                        r3[ci] = 0;
                                if (r3[ci])
@@ -2414,8 +2428,7 @@ order_joins(visitor *v, list *rels, list
                         * */
                        if (0 && popcount64(h[cje->tmp]) > 2)
                                assert(0);
-                       if (cje->type != e_cmp || !is_complex_exp(cje->flag) || 
!find_prop(cje->p, PROP_HASHCOL) ||
-                               (cje->type == e_cmp && cje->f == NULL)) {
+                       if (cje->type == e_cmp) {
                                l = rels_a[r1[cje->tmp]];
                                r = rels_a[r2[cje->tmp]];
                                if (l && r)
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -123,7 +123,7 @@ if isatty:
                     res = 
ctypes.windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi)
                     assert res
                     (bufx, bufy, curx, cury, wattr,
-                    left, top, right, bottom, maxx, maxy) = 
struct.unpack("hhhhHhhhhhh", csbi.raw)
+                    left, top, right, bottom, maxx, maxy) = 
struct.unpack('hhhhHhhhhhh', csbi.raw)
                     return wattr
                 reset = get_csbi_attributes(handle)
                 def prred(str,
@@ -273,16 +273,16 @@ def remove(file):
         Warn(f'could not remove {file}')
 
 def isexecutable(TST, ext = '.sh') :
-    if   os.name == "nt":
-        for ext in ".exe", ".com", ".bat", ".cmd":
+    if   os.name == 'nt':
+        for ext in '.exe', '.com', '.bat', '.cmd':
             if TST.lower().endswith(ext):
                 ext = ''
-            if os.path.isfile(TST+ext) or os.path.isfile(TST+ext+".src"):
+            if os.path.isfile(TST+ext) or os.path.isfile(TST+ext+'.src'):
                 return (True, ext)
-    elif os.name == "posix":
+    elif os.name == 'posix':
         TST += ext
         if ( os.path.isfile(TST       ) and os.access(TST       ,os.X_OK) ) or 
\
-           ( os.path.isfile(TST+".src") and os.access(TST+".src",os.X_OK) ):
+           ( os.path.isfile(TST+'.src') and os.access(TST+'.src',os.X_OK) ):
             return (True, ext)
     return (False, '')
 ### isexecutable(TST, ext = '.sh') #
@@ -292,7 +292,7 @@ def CheckExec(cmd) :
         x = isexecutable(os.path.join(p,cmd),'')
         if x[0]:
             return os.path.join(p, cmd + x[1])
-    return ""
+    return ''
 ### CheckExec(cmd) #
 
 import argparse
@@ -302,16 +302,16 @@ import threading
 (F_SKIP, F_OK, F_WARN, F_SOCK, F_ERROR, F_TIME, F_ABRT, F_RECU, F_SEGV, 
F_FAIL) = range(10)
 
 FAILURES = {
-    F_SKIP  : ("F_SKIP",  '-'),
-    F_OK    : ("F_OK",    'o'),
-    F_WARN  : ("F_WARN",  'x'),
-    F_SOCK  : ("F_SOCK",  'S'),
-    F_ERROR : ("F_ERROR", 'X'),
-    F_TIME  : ("F_TIME",  'T'),
-    F_ABRT  : ("F_ABRT",  'A'),
-    F_RECU  : ("F_RECU",  'R'),
-    F_SEGV  : ("F_SEGV",  'C'),
-    F_FAIL  : ("F_FAIL",  'F'),
+    F_SKIP  : ('F_SKIP',  '-'),
+    F_OK    : ('F_OK',    'o'),
+    F_WARN  : ('F_WARN',  'x'),
+    F_SOCK  : ('F_SOCK',  'S'),
+    F_ERROR : ('F_ERROR', 'X'),
+    F_TIME  : ('F_TIME',  'T'),
+    F_ABRT  : ('F_ABRT',  'A'),
+    F_RECU  : ('F_RECU',  'R'),
+    F_SEGV  : ('F_SEGV',  'C'),
+    F_FAIL  : ('F_FAIL',  'F'),
 }
 
 CONDITIONALS = {
@@ -320,28 +320,28 @@ CONDITIONALS = {
     # from configure.ag:
     # These should cover all AM_CONDITIONALS defined in configure.ag, i.e.,
     # `grep AM_CONDITIONAL configure.ag | sed 
's|^AM_CONDITIONAL(\([^,]*\),.*$|\1|' | sort -u`
-    'HAVE_CUDF'            : "@HAVE_CUDF_FALSE@",
-    'HAVE_CURL'            : "@HAVE_CURL_FALSE@",
-    'HAVE_FITS'            : "@HAVE_FITS_FALSE@",
-    'HAVE_GEOM'            : "@HAVE_GEOM_FALSE@",
-    'HAVE_HGE'             : "@HAVE_HGE_FALSE@",
-    'HAVE_LIBBZ2'          : "@HAVE_LIBBZ2_FALSE@",
-    'HAVE_LIBLZ4'          : "@HAVE_LIBLZ4_FALSE@",
-    'HAVE_LIBLZMA'         : "@HAVE_LIBLZMA_FALSE@",
-    'HAVE_LIBPCRE'         : "@HAVE_LIBPCRE_FALSE@",
-    'HAVE_LIBPY3'          : "@HAVE_LIBPY3_FALSE@",
-    'HAVE_LIBR'            : "@HAVE_LIBR_FALSE@",
-    'HAVE_LIBXML'          : "@HAVE_LIBXML_FALSE@",
-    'HAVE_LIBZ'            : "@HAVE_LIBZ_FALSE@",
-    'HAVE_NETCDF'          : "@HAVE_NETCDF_FALSE@",
-    'HAVE_ODBC'            : "@HAVE_ODBC_FALSE@",
-    'HAVE_OPENSSL'         : "@HAVE_OPENSSL_FALSE@",
-    'HAVE_PROJ'            : "@HAVE_PROJ_FALSE@",
-    'HAVE_SHP'             : "@HAVE_SHP_FALSE@",
-    'HAVE_GETENTROPY'      : "@HAVE_GETENTROPY_FALSE@",
-    'NATIVE_WIN32'         : "@NATIVE_WIN32_FALSE@",
-    'NOT_WIN32'            : "@NOT_WIN32_FALSE@",
-    'SANITIZER'            : "@SANITIZER_FALSE@",
+    'HAVE_CUDF'            : '@HAVE_CUDF_FALSE@',
+    'HAVE_CURL'            : '@HAVE_CURL_FALSE@',
+    'HAVE_FITS'            : '@HAVE_FITS_FALSE@',
+    'HAVE_GEOM'            : '@HAVE_GEOM_FALSE@',
+    'HAVE_HGE'             : '@HAVE_HGE_FALSE@',
+    'HAVE_LIBBZ2'          : '@HAVE_LIBBZ2_FALSE@',
+    'HAVE_LIBLZ4'          : '@HAVE_LIBLZ4_FALSE@',
+    'HAVE_LIBLZMA'         : '@HAVE_LIBLZMA_FALSE@',
+    'HAVE_LIBPCRE'         : '@HAVE_LIBPCRE_FALSE@',
+    'HAVE_LIBPY3'          : '@HAVE_LIBPY3_FALSE@',
+    'HAVE_LIBR'            : '@HAVE_LIBR_FALSE@',
+    'HAVE_LIBXML'          : '@HAVE_LIBXML_FALSE@',
+    'HAVE_LIBZ'            : '@HAVE_LIBZ_FALSE@',
+    'HAVE_NETCDF'          : '@HAVE_NETCDF_FALSE@',
+    'HAVE_ODBC'            : '@HAVE_ODBC_FALSE@',
+    'HAVE_OPENSSL'         : '@HAVE_OPENSSL_FALSE@',
+    'HAVE_PROJ'            : '@HAVE_PROJ_FALSE@',
+    'HAVE_SHP'             : '@HAVE_SHP_FALSE@',
+    'HAVE_GETENTROPY'      : '@HAVE_GETENTROPY_FALSE@',
+    'NATIVE_WIN32'         : '@NATIVE_WIN32_FALSE@',
+    'NOT_WIN32'            : '@NOT_WIN32_FALSE@',
+    'SANITIZER'            : '@SANITIZER_FALSE@',
     # unknown at compile time;
     # hence, we set them only at runtime in main() below
     'KNOWNFAIL'            : False, # normally skip, but --alltests or explicit
@@ -561,7 +561,7 @@ TIMES = []
 
 def ErrMsg(TEXT) :
     print(end='', flush=True)
-    print("\n%s:  ERROR:  %s\n" % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
+    print('\n%s:  ERROR:  %s\n' % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
 ### ErrMsg(TEXT) #
 
 def ErrXit(TEXT) :
@@ -575,7 +575,7 @@ def Warn(TEXT) :
     except IOError:
         pass
     try:
-        print("\n%s  Warning:  %s\n" % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
+        print('\n%s  Warning:  %s\n' % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
     except IOError:
         pass
 ### Warn(TEXT) #
@@ -610,9 +610,9 @@ def CreateHtmlIndex (env, ssout, sserr, 
     TSTTRGDIR=env['TSTTRGDIR']
 
     if TSTDIR:
-        INDEX=".index"
+        INDEX='.index'
     else:
-        INDEX="index"
+        INDEX='index'
 
     if body:
         BACK = os.getcwd()
@@ -669,16 +669,16 @@ def CreateHtmlIndex (env, ssout, sserr, 
                                Element('title', {}, Text(HTMLTITLE)),
                                stylesheet),
                        hbody)
-        f = openutf8("%s.head.html" % INDEX,"w")
+        f = openutf8('%s.head.html' % INDEX,'w')
         html.write(f, True)
         f.close()
 
         if TSTDIR:
             layout = 'rows'
-            ROWS="8%"
+            ROWS='8%'
         else:
             layout = 'cols'
-            ROWS="10%"
+            ROWS='10%'
         html = Element('html', {},
                        Element('head', {},
                                Element('meta', {'charset':'utf8'}),
@@ -706,7 +706,7 @@ def CreateHtmlIndex (env, ssout, sserr, 
                                         'bordercolor': white,
                                         'marginwidth': '0',
                                         'marginheight': '0'})))
-        f = openutf8("%s.html" % INDEX, "w")
+        f = openutf8('%s.html' % INDEX, 'w')
         html.write(f, True)
         f.close()
         os.chdir(BACK)
@@ -745,7 +745,7 @@ def CreateTstWhatXhtml (env, TST, stable
         else:
             diffclass = 'error'
 
-    SYSTEM = "%s:" % DISTVER
+    SYSTEM = '%s:' % DISTVER
 
     html = Element('html', {},
                    Element('head', {},
@@ -773,10 +773,10 @@ def CreateTstWhatXhtml (env, TST, stable
                                     'bordercolor': white,
                                     'marginwidth': '0',
                                     'marginheight': '0'})))
-    f = openutf8(".%s%s.html" % (TST, WHAT), "w")
+    f = openutf8('.%s%s.html' % (TST, WHAT), 'w')
     html.write(f, True)
     f.close()
-    f = openutf8(".%s%s.head.html" % (TST, WHAT),"w")
+    f = openutf8('.%s%s.head.html' % (TST, WHAT),'w')
     target = '%s_%s_%s_%s_body' % (DISTVER, TSTDIR, TST, WHAT[1:])
     if REV:                     # implies URLPREFIX is not None
         urlpref = '%s%s/%s' % (URLPREFIX, url(TSTDIR), TSTSUFF)
@@ -886,7 +886,7 @@ def CreateSrcIndex (env, TST, EXT) :
     if REV:
         framesrc = '%s%s/%s/%s%s' % (URLPREFIX, url(TSTDIR), TSTSUFF, TST, EXT)
     else:
-        f = openutf8(".%s.nosrc.index.html" % TST, "w")
+        f = openutf8('.%s.nosrc.index.html' % TST, 'w')
         html = Element('html', {},
                        Element('head', {},
                                Element('title', {},
@@ -927,7 +927,7 @@ def CreateSrcIndex (env, TST, EXT) :
                                     'bordercolor': white,
                                     'marginwidth': '0',
                                     'marginheight': '0'})))
-    f = openutf8(".%s.src.index.html" % TST,"w")
+    f = openutf8('.%s.src.index.html' % TST,'w')
     html.write(f, True)
     f.close()
 
@@ -962,7 +962,7 @@ def CreateSrcIndex (env, TST, EXT) :
                                             'cellspacing': '0',
                                             'cellpadding': '3'},
                                            tr))))
-    f = openutf8(".%s.src.index.head.html" % TST, "w")
+    f = openutf8('.%s.src.index.head.html' % TST, 'w')
     html.write(f, True)
     f.close()
 ### CreateSrcIndex (env, TST, EXT) #
@@ -1027,7 +1027,7 @@ def AddTstToHtmlIndex (env, TST, STABLEo
     td.addchildren(AddHref('.%s%s.html' % (TST, '.out'),
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to