Changeset: bbf76460ea5d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bbf76460ea5d
Modified Files:
        clients/Tests/MAL-signatures.stable.out.int128
        sql/backends/monet5/rel_bin.c
        testing/listexports.py.in
Branch: default
Log Message:

Merge with Oct2020 branch.


diffs (156 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -2519,6 +2519,8 @@ rel2bin_antijoin(backend *be, sql_rel *r
        return stmt_list(be, l);
 }
 
+#define complex_join_expression(e) (exp_has_func(e) && (e)->flag != 
cmp_filter) || (e)->flag == cmp_or || ((e)->f && (e)->anti)
+
 static stmt *
 rel2bin_semijoin(backend *be, sql_rel *rel, list *refs)
 {
@@ -2563,10 +2565,8 @@ rel2bin_semijoin(backend *be, sql_rel *r
                        int idx = 0, equality_only = 1;
 
                        jexps = get_equi_joins_first(sql, jexps, 
&equality_only);
-                       if (!equality_only || list_length(jexps) > 1) {
+                       if (!equality_only || list_length(jexps) > 1 || 
complex_join_expression((sql_exp*)jexps->h->data))
                                left = subrel_project(be, left, refs, rel->l);
-                               equality_only = 0;
-                       }
                        right = subrel_project(be, right, refs, rel->r);
 
                        for( en = jexps->h; en; en = en->next ) {
@@ -2575,8 +2575,7 @@ rel2bin_semijoin(backend *be, sql_rel *r
                                stmt *s = NULL;
 
                                /* only handle simple joins here */
-                               if ((exp_has_func(e) && e->flag != cmp_filter) 
||
-                                       e->flag == cmp_or || (e->f && e->anti)) 
{
+                               if (complex_join_expression(e)) {
                                        if (!join && !list_length(lje)) {
                                                stmt *l = bin_first_column(be, 
left);
                                                stmt *r = bin_first_column(be, 
right);
diff --git a/sql/test/bugs/Tests/rtrim_bug.stable.out 
b/sql/test/bugs/Tests/rtrim_bug.stable.out
--- a/sql/test/bugs/Tests/rtrim_bug.stable.out
+++ b/sql/test/bugs/Tests/rtrim_bug.stable.out
@@ -47,7 +47,7 @@ stdout of test 'rtrim_bug` in directory 
 % sys.,        sys. # table_name
 % data_length, data_value # name
 % int, varchar # type
-% 1,   1 # length
+% 1,   0 # length
 #DROP VIEW v1;
 #DROP VIEW v2;
 #DROP TABLE t1;
diff --git a/testing/exportutils.py b/testing/exportutils.py
--- a/testing/exportutils.py
+++ b/testing/exportutils.py
@@ -17,7 +17,7 @@ inclre = re.compile(r'\s*#\s*include\s+"
 # comments (/* ... */ where ... is as short as possible)
 cmtre = re.compile(r'/\*[^*]*(\*(?=[^/])[^*]*)*\*/|//.*')
 # horizontal white space
-spcre = re.compile(r'[ \t]+')
+horspcre = re.compile(r'[ \t]+')
 # identifier
 identre = re.compile(r'\b(?P<ident>[a-zA-Z_]\w*)\b')
 # undef
@@ -79,12 +79,12 @@ def process(line, funmac, macros, infunm
     nline += line[pos:]
     return nline
 
-def readfile(f, funmac=None, macros=None, files=None, printdef=False):
+def readfile(f, funmac=None, macros=None, files=None, printdef=False, 
include=False):
     data = open(f).read()
     dirname, f = os.path.split(f)
     data = cmtre.sub(' ', data)
     data = data.replace('\\\n', '')
-    data = spcre.sub(' ', data)
+    data = horspcre.sub(' ', data)
     data = data.splitlines()
     if funmac is None:
         funmac = {}
@@ -110,7 +110,7 @@ def readfile(f, funmac=None, macros=None
         if elifre.match(line) or elsere.match(line):
             if printdef:
                 ndata.append(line)
-            if skip:
+            if include and skip:
                 skip[-1] = True
             continue
         if skip and skip[-1]:
@@ -130,13 +130,14 @@ def readfile(f, funmac=None, macros=None
                     args = ()   # empty argument list
                 funmac[name] = (args, repl)
                 continue
-            macros[name] = repl
+            if include:
+                macros[name] = repl
             continue
         res = inclre.match(line)
         if res is not None:
             fn = res.group('file')
-            if '/' not in fn and os.path.exists(os.path.join(dirname, fn)) and 
fn not in files:
-                incdata = readfile(os.path.join(dirname, fn), funmac, macros, 
files, printdef)
+            if include and '/' not in fn and 
os.path.exists(os.path.join(dirname, fn)) and fn not in files:
+                incdata = readfile(os.path.join(dirname, fn), funmac, macros, 
files, printdef, include)
                 ndata.extend(incdata)
                 continue
             ndata.append(line)
@@ -154,8 +155,13 @@ def readfile(f, funmac=None, macros=None
     files.remove(f)
     return ndata
 
-def preprocess(f, printdef=False):
-    return '\n'.join(readfile(f, printdef=printdef))
+def preprocess(f, printdef=False, include=True):
+    return '\n'.join(readfile(f, printdef=printdef, include=include))
+
+# some regexps helping to normalize a declaration
+spcre = re.compile(r'\s+')
+strre = re.compile(r'([^ *])\*')
+comre = re.compile(r',\s*')
 
 def normalize(decl):
     decl = spcre.sub(' ', decl) \
@@ -175,4 +181,4 @@ def normalize(decl):
 if __name__ == '__main__':
     import sys
     for f in sys.argv[1:]:
-        print(preprocess(f, printdef=True))
+        print(preprocess(f, printdef=False))
diff --git a/testing/listexports.py.in b/testing/listexports.py.in
--- a/testing/listexports.py.in
+++ b/testing/listexports.py.in
@@ -38,7 +38,7 @@ nmere = re.compile(r'\b(?P<name>[a-zA-Z_
 def extract(f):
     decls = []
 
-    data = exportutils.preprocess(f)
+    data = exportutils.preprocess(f, include=False)
 
     res = expre.search(data)
     while res is not None:
@@ -81,8 +81,7 @@ def findfiles(dirlist, skipfiles = [], s
                     decls.extend(extract(os.path.join(root, f)))
                     done[f] = True
     decls.sort()
-    names, decls = list(zip(*decls))
-    return decls
+    return [decl for name, decl in decls]
 
 def listexports():
     output = []
diff --git a/testing/melcheck.py b/testing/melcheck.py
--- a/testing/melcheck.py
+++ b/testing/melcheck.py
@@ -76,7 +76,7 @@ def checkcommand(imp, mod, fcn, decl, re
         cpos = cres.end(0)
 
 def process1(f):
-    data = exportutils.preprocess(f)
+    data = exportutils.preprocess(f, include=True)
     pats = {}
     cmds = {}
     res = fcnre.search(data)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to