Changeset: 37d677bf1c7f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37d677bf1c7f
Added Files:
        monetdb5/mal/Tests/tst190.malC
        monetdb5/mal/Tests/tst190.stable.err
        monetdb5/mal/Tests/tst190.stable.out
        monetdb5/mal/Tests/tst191.malC
        monetdb5/mal/Tests/tst191.stable.err
        monetdb5/mal/Tests/tst191.stable.out
        monetdb5/mal/Tests/tst192.malC
        monetdb5/mal/Tests/tst192.stable.err
        monetdb5/mal/Tests/tst192.stable.out
        monetdb5/mal/Tests/tst193.malC
        monetdb5/mal/Tests/tst193.stable.err
        monetdb5/mal/Tests/tst193.stable.out
        monetdb5/mal/Tests/tst194.malC
        monetdb5/mal/Tests/tst194.stable.err
        monetdb5/mal/Tests/tst194.stable.out
        monetdb5/mal/Tests/tst195.malC
        monetdb5/mal/Tests/tst195.stable.err
        monetdb5/mal/Tests/tst195.stable.out
        monetdb5/mal/Tests/tst196.malC
        monetdb5/mal/Tests/tst196.stable.err
        monetdb5/mal/Tests/tst196.stable.out
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/extras/mal_optimizer_template/opt_sql_append.c
        monetdb5/mal/Tests/All
        monetdb5/mal/Tests/flowchk.stable.err
        monetdb5/mal/Tests/tst003.stable.err
        monetdb5/mal/Tests/tst007.malC
        monetdb5/mal/Tests/tst007.stable.err
        monetdb5/mal/Tests/tst019.stable.err
        monetdb5/mal/Tests/tst900.stable.err
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_function.c
        monetdb5/mal/mal_function.h
        monetdb5/mal/mal_parser.c
        monetdb5/mal/mal_resolve.c
        monetdb5/mal/mal_resolve.h
        monetdb5/mal/mal_session.c
        monetdb5/modules/mal/Tests/mapi06.stable.err
        monetdb5/modules/mal/orderidx.c
        monetdb5/modules/mal/remote.c
        monetdb5/optimizer/opt_aliases.c
        monetdb5/optimizer/opt_candidates.c
        monetdb5/optimizer/opt_coercion.c
        monetdb5/optimizer/opt_commonTerms.c
        monetdb5/optimizer/opt_constants.c
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_dataflow.c
        monetdb5/optimizer/opt_deadcode.c
        monetdb5/optimizer/opt_emptybind.c
        monetdb5/optimizer/opt_evaluate.c
        monetdb5/optimizer/opt_garbageCollector.c
        monetdb5/optimizer/opt_generator.c
        monetdb5/optimizer/opt_inline.c
        monetdb5/optimizer/opt_jit.c
        monetdb5/optimizer/opt_json.c
        monetdb5/optimizer/opt_macro.c
        monetdb5/optimizer/opt_matpack.c
        monetdb5/optimizer/opt_mergetable.c
        monetdb5/optimizer/opt_mitosis.c
        monetdb5/optimizer/opt_multiplex.c
        monetdb5/optimizer/opt_oltp.c
        monetdb5/optimizer/opt_postfix.c
        monetdb5/optimizer/opt_profiler.c
        monetdb5/optimizer/opt_projectionpath.c
        monetdb5/optimizer/opt_pushselect.c
        monetdb5/optimizer/opt_querylog.c
        monetdb5/optimizer/opt_reduce.c
        monetdb5/optimizer/opt_remap.c
        monetdb5/optimizer/opt_remoteQueries.c
        monetdb5/optimizer/opt_reorder.c
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_volcano.c
        monetdb5/optimizer/opt_wlc.c
        monetdb5/optimizer/opt_wrapper.c
        monetdb5/scheduler/run_adder.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
Branch: gdk_tracer
Log Message:

The chkProgram() and chkDeclaration() now return a proper exception string
and don't use the 'hidden' mb->errors. The first type error aborts the analysis.


diffs (truncated from 1709 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2067,10 +2067,10 @@ str callMAL(Client cntxt, MalBlkPtr mb, 
 str callString(Client c, str s, int listing);
 str capiRef;
 str catalogRef;
-void chkDeclarations(MalBlkPtr mb);
+str chkDeclarations(MalBlkPtr mb);
 void chkFlow(MalBlkPtr mb);
 int chkInstruction(Module s, MalBlkPtr mb, InstrPtr p);
-void chkProgram(Module s, MalBlkPtr mb);
+str chkProgram(Module s, MalBlkPtr mb);
 void chkTypes(Module s, MalBlkPtr mb, int silent);
 str cleanupTraces(Client cntxt);
 void clearStack(MalStkPtr s);
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c 
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
+++ b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
@@ -296,7 +296,7 @@ str OPTsql_append(Client cntxt, MalBlkPt
     /* Defense line against incorrect plans */
        chkTypes(cntxt->usermodule, mb, FALSE);
        chkFlow(mb);
-       chkDeclarations(mb);
+       if( msg == MAL_SUCCEED) msg = chkDeclarations(mb);
 #ifdef DEBUG_OPT_OPTIMIZERS
                mnstr_printf(cntxt->fdout,"=FINISHED sql_append %d\n",actions);
                printFunction(cntxt->fdout,mb,0,LIST_MAL_ALL );
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -95,6 +95,13 @@ tst161
 tst163
 tst1604
 tst171
+tst190
+tst191
+tst192
+tst193
+tst194
+tst195
+tst196
 tst200
 tst201
 tst202
diff --git a/monetdb5/mal/Tests/flowchk.stable.err 
b/monetdb5/mal/Tests/flowchk.stable.err
--- a/monetdb5/mal/Tests/flowchk.stable.err
+++ b/monetdb5/mal/Tests/flowchk.stable.err
@@ -77,8 +77,7 @@ QUERY = function tst();
         exit go;
                c:=a;
         end tst;
-ERROR = !TypeException:user.tst[5]:'a' may not be used before being initialized
-
+ERROR = !MALException:user.tst:'a' may not be used before being initialized
 
 # 07:33:12 >  
 # 07:33:12 >  "Done."
diff --git a/monetdb5/mal/Tests/tst003.stable.err 
b/monetdb5/mal/Tests/tst003.stable.err
--- a/monetdb5/mal/Tests/tst003.stable.err
+++ b/monetdb5/mal/Tests/tst003.stable.err
@@ -37,8 +37,7 @@ QUERY = # test illegal variable use
         a:=b;  #b not yet defined
         b:=c;  #c undefined
         end foo;
-ERROR = !TypeException:user.foo[1]:'b' may not be used before being initialized
-        !TypeException:user.foo[3]:'c' may not be used before being initialized
+ERROR = !MALException:user.foo:'b' may not be used before being initialized
 
 # 22:10:36 >  
 # 22:10:36 >  "Done."
diff --git a/monetdb5/mal/Tests/tst007.malC b/monetdb5/mal/Tests/tst007.malC
--- a/monetdb5/mal/Tests/tst007.malC
+++ b/monetdb5/mal/Tests/tst007.malC
@@ -18,7 +18,7 @@ exit  (h,t);
        
 #een do-while loop
        entry:= true;
-barrier M:= entry_or_exittest;
+barrier M:= entry_or_exit;
        entry:= false;
        # rest
 redo   M;
diff --git a/monetdb5/mal/Tests/tst007.stable.err 
b/monetdb5/mal/Tests/tst007.stable.err
--- a/monetdb5/mal/Tests/tst007.stable.err
+++ b/monetdb5/mal/Tests/tst007.stable.err
@@ -51,7 +51,7 @@ QUERY = # A collection of forloops, whic
                
         #een do-while loop
                entry:= true;
-        barrier M:= entry_or_exittest;
+        barrier M:= entry_or_exit;
                entry:= false;
                # rest
         redo   M;
@@ -80,7 +80,8 @@ QUERY = # A collection of forloops, whic
         exit   FS;
         
         end foo;
-ERROR = !TypeException:user.foo[16]:'entry_or_exittest' may not be used before 
being initialized
+ERROR = !MALException:user.foo:'entry_or_exit' may not be used before being 
initialized
+
 
 # 13:48:22 >  
 # 13:48:22 >  "Done."
diff --git a/monetdb5/mal/Tests/tst019.stable.err 
b/monetdb5/mal/Tests/tst019.stable.err
--- a/monetdb5/mal/Tests/tst019.stable.err
+++ b/monetdb5/mal/Tests/tst019.stable.err
@@ -80,7 +80,7 @@ ERROR = !TypeException:user.welcome[3]:t
         !MALException:user.welcome3[2]:invalid return target!
         !TypeException:user.welcome4[2]:Multiple assignment mismatch
 
-# 13:48:26 >  
-# 13:48:26 >  "Done."
-# 13:48:26 >  
+# 15:16:11 >  
+# 15:16:11 >  "Done."
+# 15:16:11 >  
 
diff --git a/monetdb5/mal/Tests/tst190.malC b/monetdb5/mal/Tests/tst190.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst190.malC
@@ -0,0 +1,7 @@
+function welcome(lim:int):void;
+    i:= 2;
+    w:="hello";
+    return w;   # should produce a type error
+end welcome;
+
+user.welcome(1);
diff --git a/monetdb5/mal/Tests/tst190.stable.err 
b/monetdb5/mal/Tests/tst190.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst190.stable.err
@@ -0,0 +1,40 @@
+stderr of test 'tst190` in directory 'monetdb5/mal` itself:
+
+
+# 13:41:49 >  
+# 13:41:49 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=33650" "--set" 
"mapi_usock=/var/tmp/mtest-26223/.s.monetdb.33650" "--forcemito" 
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal"
 "--set" "embedded_c=true"
+# 13:41:49 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/branches/default//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# builtin opt  raw_strings = false
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 33650
+# cmdline opt  mapi_usock = /var/tmp/mtest-26223/.s.monetdb.33650
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal
+# cmdline opt  embedded_c = true
+
+# 13:41:49 >  
+# 13:41:49 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-26223" "--port=33650"
+# 13:41:49 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-26223/.s.monetdb.33650
+QUERY = function welcome(lim:int):void;
+            i:= 2;
+            w:="hello";
+            return w;   # should produce a type error
+        end welcome;
+        
+        user.welcome(1);
+ERROR = !TypeException:user.welcome[3]:type mismatch void := str
+
+# 13:41:49 >  
+# 13:41:49 >  "Done."
+# 13:41:49 >  
+
diff --git a/monetdb5/mal/Tests/tst190.stable.out 
b/monetdb5/mal/Tests/tst190.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst190.stable.out
@@ -0,0 +1,29 @@
+stdout of test 'tst190` in directory 'monetdb5/mal` itself:
+
+
+# 13:41:49 >  
+# 13:41:49 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=33650" "--set" 
"mapi_usock=/var/tmp/mtest-26223/.s.monetdb.33650" "--forcemito" 
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal"
 "--set" "embedded_c=true"
+# 13:41:49 >  
+
+# MonetDB 5 server v11.36.0 (hg id: ff3b8d075206+)
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_mal', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 31.307 GiB available main-memory of which we use 25.515 GiB
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://toke.da.cwi.nl:33650/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-26223/.s.monetdb.33650
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+# 13:41:49 >  
+# 13:41:49 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-26223" "--port=33650"
+# 13:41:49 >  
+
+
+# 13:41:49 >  
+# 13:41:49 >  "Done."
+# 13:41:49 >  
+
diff --git a/monetdb5/mal/Tests/tst191.malC b/monetdb5/mal/Tests/tst191.malC
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst191.malC
@@ -0,0 +1,8 @@
+function welcome0(lim:int):str;
+    i:= 2;
+    w:="hello";
+    return (w,i);   # should produce a type error
+end welcome0;
+
+y:= user.welcome0(1);
+io.print(y);
diff --git a/monetdb5/mal/Tests/tst191.stable.err 
b/monetdb5/mal/Tests/tst191.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst191.stable.err
@@ -0,0 +1,41 @@
+stderr of test 'tst191` in directory 'monetdb5/mal` itself:
+
+
+# 13:41:49 >  
+# 13:41:49 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=33650" "--set" 
"mapi_usock=/var/tmp/mtest-26223/.s.monetdb.33650" "--forcemito" 
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal"
 "--set" "embedded_c=true"
+# 13:41:49 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/mk/branches/default//Linux/var/monetdb5/dbfarm/demo
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_ipv6 = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# builtin opt  raw_strings = false
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 33650
+# cmdline opt  mapi_usock = /var/tmp/mtest-26223/.s.monetdb.33650
+# cmdline opt  gdk_dbpath = 
/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal
+# cmdline opt  embedded_c = true
+
+# 13:41:49 >  
+# 13:41:49 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-26223" "--port=33650"
+# 13:41:49 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-26223/.s.monetdb.33650
+QUERY = function welcome0(lim:int):str;
+            i:= 2;
+            w:="hello";
+            return (w,i);   # should produce a type error
+        end welcome0;
+        
+        y:= user.welcome0(1);
+        io.print(y);
+ERROR = !TypeException:user.welcome0[3]:Multiple assignment mismatch
+
+# 13:41:49 >  
+# 13:41:49 >  "Done."
+# 13:41:49 >  
+
diff --git a/monetdb5/mal/Tests/tst191.stable.out 
b/monetdb5/mal/Tests/tst191.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/Tests/tst191.stable.out
@@ -0,0 +1,29 @@
+stdout of test 'tst191` in directory 'monetdb5/mal` itself:
+
+
+# 13:41:49 >  
+# 13:41:49 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=33650" "--set" 
"mapi_usock=/var/tmp/mtest-26223/.s.monetdb.33650" "--forcemito" 
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_mal"
 "--set" "embedded_c=true"
+# 13:41:49 >  
+
+# MonetDB 5 server v11.36.0 (hg id: ff3b8d075206+)
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_mal', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 31.307 GiB available main-memory of which we use 25.515 GiB
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://toke.da.cwi.nl:33650/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-26223/.s.monetdb.33650
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+# 13:41:49 >  
+# 13:41:49 >  "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" 
"--host=/var/tmp/mtest-26223" "--port=33650"
+# 13:41:49 >  
+
+
+# 13:41:49 >  
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to