Changeset: d1db10c3dec6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d1db10c3dec6
Modified Files:
        sql/include/sql_relation.h
        sql/server/rel_optimizer_private.h
Branch: groupjoin
Log Message:

merged with default


diffs (187 lines):

diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h
--- a/sql/include/sql_relation.h
+++ b/sql/include/sql_relation.h
@@ -143,8 +143,7 @@ typedef enum ddl_statement {
        ddl_comment_on,
        ddl_rename_schema,
        ddl_rename_table,
-       ddl_rename_column,
-       ddl_maxops /* evaluated to the max value, should be always kept at the 
bottom */
+       ddl_rename_column
 } ddl_statement;
 
 typedef enum operator_type {
@@ -169,7 +168,7 @@ typedef enum operator_type {
        op_update,      /* update(l=table, r update expressions) */
        op_delete,      /* delete(l=table, r delete expression) */
        op_truncate, /* truncate(l=table) */
-       op_merge
+       op_merge         /* IMPORTANT: keep op_merge last */
 } operator_type;
 
 #define is_atom(et)            (et == e_atom)
diff --git a/sql/server/rel_optimizer_private.h 
b/sql/server/rel_optimizer_private.h
--- a/sql/server/rel_optimizer_private.h
+++ b/sql/server/rel_optimizer_private.h
@@ -15,7 +15,7 @@
 
 /* relations counts */
 typedef struct global_props {
-       int cnt[ddl_maxops];
+       int cnt[op_merge + 1];
        uint8_t
                instantiate:1,
                needs_mergetable_rewrite:1,
diff --git a/sql/test/prepare/Tests/named_placeholders.test 
b/sql/test/prepare/Tests/named_placeholders.test
--- a/sql/test/prepare/Tests/named_placeholders.test
+++ b/sql/test/prepare/Tests/named_placeholders.test
@@ -3,3 +3,24 @@ SELECT :banana;
 
 statement error 42000!Named placeholder ('pear') not used in the query.
 SELECT :banana : ( pear 'mango' );        
+
+query T
+SELECT :banana : ( banana 'foo');
+----
+foo
+
+statement ok
+create table tst_table (x int, y int);
+
+statement ok
+insert into tst_table (x, y) values (:x, :y) : (x 1, y 1);
+insert into tst_table (x, y) values (:x, :y) : (x 2, y 4);
+
+query II rowsort
+SELECT x, y from tst_table;
+----
+1
+1
+2
+4
+
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2069,7 +2069,7 @@ def RunTest(env, TST, COND, oktests, len
                 rversion = os.path.join('@LIBR_INCLUDE_DIRS@', 'Rversion.h')
                 if os.path.exists(rversion):
                     with openutf8(rversion, 'r') as f:
-                        res = re.search('#define R_VERSION (?P<rversion>\d+)', 
f.read())
+                        res = re.search(r'#define R_VERSION 
(?P<rversion>\d+)', f.read())
                         if res is not None:
                             r_version = res.group('rversion')
                             req_version = cond[11:].split('.')
@@ -2130,7 +2130,7 @@ def RunTest(env, TST, COND, oktests, len
         reason = "as multiple SQL clients in parallel are currently not 
supported by %s." % THISFILE
         elem = SkipTest(env, TST, EXT, reason, length)
     else:
-        test = re.compile("^"+TST+"((_[sp][0-9][0-9])?\..*)?$", re.MULTILINE)
+        test = re.compile("^"+TST+r"((_[sp][0-9][0-9])?\..*)?$", re.MULTILINE)
         for f in listdir(RELSRCDIR):
             if test.match(f):
                 try:
@@ -2159,7 +2159,7 @@ def RunTest(env, TST, COND, oktests, len
                 reason = "as source file '%s` is missing." % TSTSRC
                 elem = SkipTest(env, TST, EXT+".src", reason, length)
                 return TX,Failed,Failed,elem,reason,links
-        test = re.compile("^"+TST+"((_[sp][0-9][0-9])?\..*)?\.src$", 
re.MULTILINE)
+        test = re.compile("^"+TST+r"((_[sp][0-9][0-9])?\..*)?\.src$", 
re.MULTILINE)
         for ff in listdir(TSTTRGDIR):
             if test.match(ff) and not os.path.isfile(ff[:-4]):
                 f = openutf8(ff,"r")
@@ -2174,7 +2174,7 @@ def RunTest(env, TST, COND, oktests, len
                                % (TSTSRC, ff[:-4], os.getcwd(), err.errno, 
err.strerror))
                 else:
                     Warn("source file '"+TSTSRC+"` is missing.")
-        test = re.compile("^"+TST+"(_[sp][0-9][0-9])?\..*\.in$", re.MULTILINE)
+        test = re.compile("^"+TST+r"(_[sp][0-9][0-9])?\..*\.in$", re.MULTILINE)
         for ff in listdir(TSTTRGDIR):
             fff = ff[:-3]
             if test.match(ff) and not os.path.isfile(fff):
@@ -2535,7 +2535,7 @@ def killProc(proc, outfile = None, cmd =
                 sym = r'c:\Symbols;'
         elif os.path.exists(r'c:\Program Files\Debugging Tools for Windows 
(x86)\cdb.exe'):
             cdb = r'c:\Program Files\Debugging Tools for Windows (x86)\cdb.exe'
-            if os.path.exists('c:\WINDOWS\Symbols'):
+            if os.path.exists(r'c:\WINDOWS\Symbols'):
                 sym = r'c:\WINDOWS\Symbols;'
         else:
             cdb = None
@@ -3076,11 +3076,11 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
 
     # Try to detect segfaults and the like
     # Try to detect aborts due to too deep recursion
-    for (regexp, msg) in [("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus 
[Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))",
+    for (regexp, msg) in [("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus 
[Ee]rror|Aborted|Assertion (|.* )failed[:.]|!FATAL: BATSIGabort:)([ \t]|$))",
                            'segfault'),
                           ("aborted too deep recursion",
                            'recursion'),
-                          ("mal_mapi\.listen:operation failed: bind to stream 
socket port",
+                          (r"mal_mapi\.listen:operation failed: bind to stream 
socket port",
                            'socket')]:
         TO = re.compile(regexp, re.MULTILINE)
         # FIXME: this begs for a much nicer solution (100% copy of below)
@@ -3257,7 +3257,7 @@ os.environ['MAPIHOST'] = HOST
 if os.name == "nt":
     SYST    = "Windows"
     RELEASE = "5.0"
-    r = re.compile('^Microsoft Windows (.*)\[Version 
([0-9]+\.[0-9]+)([^\[0-9].*)\]$')
+    r = re.compile(r'^Microsoft Windows (.*)\[Version 
([0-9]+\.[0-9]+)([^\[0-9].*)\]$')
     if procdebug:
         print('starting process "cmd" "/c" "ver" (inpipe,outpipe)\n')
     with process.Popen('cmd /c ver', stdin=process.PIPE,
@@ -3361,7 +3361,7 @@ if SYST == "Linux":
     elif os.path.isfile('/etc/debian_version'):
         LINUX_DIST = "Debian:"+open('/etc/debian_version').readline().strip()
     if not LINUX_DIST:
-        LINUX_DIST = SYST+':'+re.match('^([0-9\.]*)([^0-9\.].*)$', 
RELEASE).group(1)
+        LINUX_DIST = SYST+':'+re.match(r'^([0-9.]*)([^0-9.].*)$', 
RELEASE).group(1)
     DIST,VERSION = LINUX_DIST.split(':', 1)
 elif SYST == "SunOS" and os.path.isfile('/etc/release'):
     (DIST,VERSION,rest) = open('/etc/release').readline().strip().split(' ',2)
@@ -3651,7 +3651,7 @@ def main(argv) :
                            stdout=process.PIPE, stderr=process.PIPE,
                            text=True) as proc:
             ruby_out, ruby_err = proc.communicate()
-        ruby_reg = re.compile("^[^ ]* ([0-9]+)\.([0-9]+)[^0-9].*$", 
re.MULTILINE)
+        ruby_reg = re.compile(r"^[^ ]* ([0-9]+)\.([0-9]+)[^0-9].*$", 
re.MULTILINE)
         ruby_ver = ruby_reg.match(ruby_out)
         if ruby_ver and \
            100 * int(ruby_ver.group(1)) + int(ruby_ver.group(2)) >= 109:
diff --git a/testing/explain.py b/testing/explain.py
--- a/testing/explain.py
+++ b/testing/explain.py
@@ -19,7 +19,7 @@ def function_histogram(tab):
     histo = {}
     for row in tab:
         if row[0].find('usec') < 0:
-            g = 
re.match('^[^#].*\s([a-zA-Z_][a-zA-Z_0-9]*\.[a-zA-Z_][a-zA-Z_0-9]*)\(.*;', 
row[0])
+            g = 
re.match(r'^[^#].*\s([a-zA-Z_][a-zA-Z_0-9]*\.[a-zA-Z_][a-zA-Z_0-9]*)\(.*;', 
row[0])
             if g:
                 f = g.group(1)
                 if f in histo:
@@ -36,9 +36,9 @@ def function_with_more_than_one_result_b
     histo = {}
     for row in tab:
         if row[0].find('usec') < 0:
-            g = re.match('^[^#].*\(([A-Z]\_[0-9]+:bat\[:[a-z]+\],?\ ?)+\)\ :=\ 
.*;', row[0])
+            g = re.match(r'^[^#].*\(([A-Z]\_[0-9]+:bat\[:[a-z]+\],?\ ?)+\)\ 
:=\ .*;', row[0])
             if g:
-                g2 = 
re.match('^[^#].*\s([a-zA-Z_][a-zA-Z_0-9]*\.[a-zA-Z_][a-zA-Z_0-9]*)\(.*;', 
row[0])
+                g2 = 
re.match(r'^[^#].*\s([a-zA-Z_][a-zA-Z_0-9]*\.[a-zA-Z_][a-zA-Z_0-9]*)\(.*;', 
row[0])
                 if g2:
                     f = g2.group(1)
                     if f in histo:
diff --git a/testing/melcheck.py b/testing/melcheck.py
--- a/testing/melcheck.py
+++ b/testing/melcheck.py
@@ -15,7 +15,7 @@ except ImportError:
 
 # MEL pattern
 argreg = 
r'\s*,\s*(?P<bat>bat)?(?P<var>var)?arg(?P<any>any)?\s*\(\s*(?P<argname>"[^"]*")\s*,\s*(?P<argval>\w*)\s*\)'
-patreg = 
r'^\s*(?P<cmdpat>pattern|command)\s*\(\s*"(?P<mod>[^"]*)"\s*,\s*"(?P<fcn>[^"]*)"\s*,\s*(?P<imp>\w+)\s*,[^,]*,\s*"[^\"]*(?:\\.[^\"]*)*"\s*,\s*args\s*\(\s*(?P<retc>\d+)\s*,\s*(?P<argc>\d+)(?P<args>(?:'+argreg+')*)\s*\)\s*\)'
+patreg = 
r'^\s*(?P<cmdpat>pattern|command)\s*\(\s*"(?P<mod>[^"]*)"\s*,\s*"(?P<fcn>[^"]*)"\s*,\s*(?P<imp>\w+)\s*,[^,]*,\s*"[^\"]*(?:\\.[^\"]*)*"\s*,\s*args\s*\(\s*(?P<retc>\d+)\s*,\s*(?P<argc>\d+)(?P<args>(?:'+argreg+r')*)\s*\)\s*\)'
 
 argre = re.compile(argreg)
 patre = re.compile(patreg, re.MULTILINE)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to