Changeset: c768a7ecd0ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c768a7ecd0ee
Added Files:
        sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.sql
        sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.err
        sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.out
Modified Files:
        sql/server/rel_optimizer.c
        sql/test/BugTracker-2018/Tests/All
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Aug2018 branch.


diffs (truncated from 385 to 300 lines):

diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -6968,7 +6968,7 @@ rel_simplify_predicates(int *changes, mv
                                /* remove simple select true expressions */
                                if (flag) {
                                        sql->caching = 0;
-                                       break;
+                                       continue;
                                }
                        }
                        if (e->type == e_cmp && get_cmp(e) == cmp_equal) {
@@ -9453,7 +9453,7 @@ optimize(mvc *sql, sql_rel *rel, int val
        int level = 0, changes = 1;
 
        rel_reset_subquery(rel);
-       for( ;rel && level < 20 && changes; level++) 
+       for( ;rel && level < 20 && changes; level++)
                rel = optimize_rel(sql, rel, &changes, level, value_based_opt);
        return rel;
 }
diff --git a/sql/test/BugTracker-2018/Tests/All 
b/sql/test/BugTracker-2018/Tests/All
--- a/sql/test/BugTracker-2018/Tests/All
+++ b/sql/test/BugTracker-2018/Tests/All
@@ -88,3 +88,4 @@ update-transaction-select.Bug-6649
 prepared-statement-with-udf.Bug-6650
 in-subquery-having-Bug-6651
 create_table_empty_column_name.Bug-6653
+select_where_true.Bug-6654
diff --git a/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.sql 
b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.sql
@@ -0,0 +1,7 @@
+start transaction;
+create table stmp(i integer);
+insert into stmp values (0),(1),(2);
+select * from stmp S where S.i = 0;
+select * from stmp S where true and S.i = 0;
+select * from stmp S where  S.i = 0 and true;
+rollback;
diff --git 
a/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.err 
b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'select_where_true.Bug-6654` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 17:28:43 >  
+# 17:28:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31895" "--set" 
"mapi_usock=/var/tmp/mtest-15075/.s.monetdb.31895" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/ferreira/repositories/MonetDB-Aug2018/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_c=true"
+# 17:28:43 >  
+
+# builtin opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Aug2018/BUILD/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 31895
+# cmdline opt  mapi_usock = /var/tmp/mtest-15075/.s.monetdb.31895
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/home/ferreira/repositories/MonetDB-Aug2018/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2018
+# cmdline opt  embedded_c = true
+# cmdline opt  gdk_debug = 553648138
+
+# 17:28:43 >  
+# 17:28:43 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-15075" "--port=31895"
+# 17:28:43 >  
+
+
+# 17:28:43 >  
+# 17:28:43 >  "Done."
+# 17:28:43 >  
+
diff --git 
a/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.out 
b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/select_where_true.Bug-6654.stable.out
@@ -0,0 +1,94 @@
+stdout of test 'select_where_true.Bug-6654` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 17:28:43 >  
+# 17:28:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31895" "--set" 
"mapi_usock=/var/tmp/mtest-15075/.s.monetdb.31895" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/ferreira/repositories/MonetDB-Aug2018/BUILD/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_c=true"
+# 17:28:43 >  
+
+# MonetDB 5 server v11.31.10
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2018', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 15.492 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://wired-142.cwi.nl:31895/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-15075/.s.monetdb.31895
+# MonetDB/GIS module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 18_index.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_views.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 40_json_hge.sql
+# loading sql script: 41_md5sum.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 46_profiler.sql
+# loading sql script: 51_sys_schema_extension.sql
+# loading sql script: 60_wlcr.sql
+# loading sql script: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_lidar.sql
+# loading sql script: 75_shp.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 85_bam.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 17:28:43 >  
+# 17:28:43 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-15075" "--port=31895"
+# 17:28:43 >  
+
+#start transaction;
+#create table stmp(i integer);
+#insert into stmp values (0),(1),(2);
+[ 3    ]
+#select * from stmp S where S.i = 0;
+% sys.s # table_name
+% i # name
+% int # type
+% 1 # length
+[ 0    ]
+#select * from stmp S where true and S.i = 0;
+% sys.s # table_name
+% i # name
+% int # type
+% 1 # length
+[ 0    ]
+#select * from stmp S where  S.i = 0 and true;
+% sys.s # table_name
+% i # name
+% int # type
+% 1 # length
+[ 0    ]
+#rollback;
+
+# 17:28:43 >  
+# 17:28:43 >  "Done."
+# 17:28:43 >  
+
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -344,6 +344,7 @@ F_TIME = 4
 F_ABRT = 5
 F_RECU = 6
 F_SEGV = 7
+F_MISSING = 8
 
 FAILURES = {
     F_SKIP  : ("F_SKIP",  '-'),
@@ -355,6 +356,7 @@ FAILURES = {
     F_ABRT  : ("F_ABRT",  'A'),
     F_RECU  : ("F_RECU",  'R'),
     F_SEGV  : ("F_SEGV",  'C'),
+    F_MISSING: ("F_MISSING", 'M'),
 }
 
 CONDITIONALS = {
@@ -832,6 +834,9 @@ def CreateTstWhatXhtml (env, TST, stable
         elif result == F_SEGV:
             diffclass = 'segfault'
             difftext += ' (Crash)'
+        elif result == F_MISSING:
+            diffclass = 'error'
+            difftext += ' (Output missing)'
         else:
             diffclass = 'error'
 
@@ -1075,6 +1080,8 @@ def AddHref (href, target, linktext, dif
         klass = 'segfault'
     elif diff == F_WARN:
         klass = 'warning'
+    elif diff == F_MISSING:
+        klass = 'error'
     else:
         klass = 'good'
     a = Element('a', {'href': href, 'target': target, 'class': klass},
@@ -1091,9 +1098,7 @@ def AddTstToHtmlIndex (env, TST, STABLEo
     CreateTstWhatXhtml(env, TST, STABLEout, EXT, o)
     CreateTstWhatXhtml(env, TST, STABLEerr, EXT, e)
 
-    if o == F_ERROR or e == F_ERROR:
-        tstclass = 'error'
-    elif e == F_RECU:
+    if e == F_RECU:
         tstclass = 'recursion'
     elif e == F_TIME:
         tstclass = 'timeout'
@@ -1103,6 +1108,10 @@ def AddTstToHtmlIndex (env, TST, STABLEo
         tstclass = 'abort'
     elif e == F_SEGV:
         tstclass = 'segfault'
+    elif o == F_MISSING or e == F_MISSING:
+        tstclass = 'error'
+    elif o == F_ERROR or e == F_ERROR:
+        tstclass = 'error'
     elif o == F_WARN or e == F_WARN:
         tstclass = 'warning'
     else:
@@ -1850,7 +1859,7 @@ def StableOutErr(env,par,TST,SYST,RELEAS
     return STABLEout, STABLEerr
 ### StableOutErr(env,par,TST,SYST,RELEASE,DIST,VERSION) #
 
-def CategorizeResult(TST, SockTime):
+def CategorizeResult(TST, SockTime, outmissing, errmissing):
     l = '<!--MajorDiffs-->'   # assign something in case file is empty
     for l in open("%s.out.diff.html" % TST):
         pass
@@ -1859,7 +1868,10 @@ def CategorizeResult(TST, SockTime):
     elif l.startswith('<!--MinorDiffs-->'):
         o = F_WARN
     elif l.startswith('<!--MajorDiffs-->'):
-        o = F_ERROR
+        if outmissing:
+            o = F_MISSING
+        else:
+            o = F_ERROR
     else:
         Warn("Unexpected last line in %s.out.diff.html:\n%s" % (TST, l))
         ff = open("%s.out.diff.html" % TST, "a")
@@ -1874,7 +1886,10 @@ def CategorizeResult(TST, SockTime):
     elif l.startswith('<!--MinorDiffs-->'):
         e = F_WARN
     elif l.startswith('<!--MajorDiffs-->'):
-        e = F_ERROR
+        if errmissing:
+            e = F_MISSING
+        else:
+            e = F_ERROR
     else:
         Warn("Unexpected last line in %s.err.diff.html:\n%s" % (TST, l))
         ff = open("%s.err.diff.html" % TST, "a")
@@ -2152,12 +2167,15 @@ def RunTest(env, TST, BusyPorts, COND, o
         ACCURACYout = par['ACCURACY']
         ACCURACYerr = par['ACCURACY']
         STABLEout,STABLEerr = 
StableOutErr(env,par,TST,SYST,RELEASE,DIST,VERSION)
+        outmissing = errmissing = False
         if not os.path.isfile(TST+STABLEout):
             open(TST+STABLEout,"w").close()
             ACCURACYout = 0
+            outmissing = True
         if not os.path.isfile(TST+STABLEerr):
             open(TST+STABLEerr,"w").close()
             ACCURACYerr = 0
+            errmissing = True
 
         PRELUDE = []
         if EXT !=  '.sql':
@@ -2203,49 +2221,12 @@ def RunTest(env, TST, BusyPorts, COND, o
 
         t0 = time.time()
         tres = DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOutFile, 
TestErrFile, STIMEOUT, CTIMEOUT, TIMEOUT, ME, MAPIsockets, length, nomito, 
threads, user, passwd, COND, all_tests)
-        if tres == 'segfault':
-            # rename core file, if any -- might have to check
-            # /proc/sys/kernel/core_pattern in the future but hopefully
-            # this value is kept sane
-            corefile = os.path.join(env['GDK_DBFARM'], env['TSTDB'], 'core')
-            if not os.path.exists(corefile):
-                corefile = None
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to