Changeset: b1604d8a3e25 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b1604d8a3e25 Modified Files: MonetDB5/src/mal/Tests/All MonetDB5/src/mal/Tests/tst036.mal MonetDB5/src/mal/Tests/tst036.stable.err MonetDB5/src/mal/Tests/tst036.stable.out MonetDB5/src/mal/mal_resolve.mx Branch: Jun2010 Log Message:
back-ported changeset f3eacb82a7a5 from default branch to Jun2010 branch: " user: m...@cwi.nl description: Detect improve use of multiple assignments The instruction s:=(1,2) was not catched as an error. " diffs (153 lines): diff -r d3b433a65d94 -r b1604d8a3e25 MonetDB5/src/mal/Tests/All --- a/MonetDB5/src/mal/Tests/All Tue Jul 20 17:53:13 2010 +0200 +++ b/MonetDB5/src/mal/Tests/All Tue Jul 20 21:47:20 2010 +0200 @@ -32,6 +32,7 @@ tst033 tst034 tst035 +tst036 HAVE_PCRE?tst037 tst038 tst039 diff -r d3b433a65d94 -r b1604d8a3e25 MonetDB5/src/mal/Tests/tst036.mal --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MonetDB5/src/mal/Tests/tst036.mal Tue Jul 20 21:47:20 2010 +0200 @@ -0,0 +1,8 @@ +# test for proper use of list assignments +(z0,z1):= (1,"help"); +io.print(z0); +io.print(z1); +# all three are wrong + l1:= (1,2); +(l2,l3):= 3; +(l4,l5) := (4,5,6); diff -r d3b433a65d94 -r b1604d8a3e25 MonetDB5/src/mal/Tests/tst036.stable.err --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MonetDB5/src/mal/Tests/tst036.stable.err Tue Jul 20 21:47:20 2010 +0200 @@ -0,0 +1,75 @@ +stderr of test 'tst036` in directory 'src/mal` itself: + + +# 17:28:20 > +# 17:28:20 > mserver5 "--config=/ufs/mk/Jun2010//Linux/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/mk/Jun2010//Linux/lib/MonetDB5:/ufs/mk/Jun2010//Linux/lib/MonetDB5/lib:/ufs/mk/Jun2010//Linux/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/mk/Jun2010//Linux/var/MonetDB5/dbfarm" --set mapi_open=true --set xrpc_open=true --set mapi_port=38406 --set xrpc_port=45263 --set monet_prompt= --set mal_listing=2 --trace --dbname=mTests_src_mal tst036.mal +# 17:28:20 > + +# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu +# builtin opt gdk_version = 1.39.0 +# builtin opt prefix = /ufs/mk/Jun2010//Linux +# builtin opt exec_prefix = ${prefix} +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# builtin opt gdk_vmtrim = yes +# builtin opt monet_admin = adm +# builtin opt monet_prompt = > +# builtin opt monet_welcome = yes +# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB +# builtin opt monet_daemon = no +# builtin opt host = localhost +# builtin opt mapi_port = 50000 +# builtin opt mapi_clients = 2 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_debug = 0 +# builtin opt standoff_ns = +# builtin opt standoff_start = start +# builtin opt standoff_end = end +# config opt prefix = /ufs/mk/Jun2010//Linux +# config opt config = ${prefix}/etc/monetdb5.conf +# config opt prefix = /ufs/mk/Jun2010//Linux +# config opt exec_prefix = ${prefix} +# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm +# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin +# config opt mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid +# config opt mero_controlport = 50001 +# config opt sql_optimizer = default_pipe +# config opt minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector +# config opt default_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt no_mitosis_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt sequential_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,history,multiplex,garbageCollector +# config opt nov2009_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt replication_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector +# config opt accumulator_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,accumulators,dataflow,history,multiplex,garbageCollector +# config opt recycler_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,deadcode,recycle,reduce,dataflow,history,multiplex,garbageCollector +# config opt cracker_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,selcrack,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt sidcrack_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,sidcrack,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt datacell_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,datacell,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt octopus_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,octopus,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt mapreduce_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mapreduce,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt datacyclotron_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,datacyclotron,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector +# config opt derive_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,derivePath,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt dictionary_pipe = inline,remap,dictionary,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector +# config opt compression_pipe = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,compression,dataflow,history,multiplex,garbageCollector +# config opt opt_debug = +# cmdline opt config = /ufs/mk/Jun2010//Linux/etc/monetdb5.conf +# cmdline opt gdk_nr_threads = 0 +# cmdline opt monet_mod_path = /ufs/mk/Jun2010//Linux/lib/MonetDB5:/ufs/mk/Jun2010//Linux/lib/MonetDB5/lib:/ufs/mk/Jun2010//Linux/lib/MonetDB5/bin +# cmdline opt gdk_dbfarm = /ufs/mk/Jun2010//Linux/var/MonetDB5/dbfarm +# cmdline opt mapi_open = true +# cmdline opt xrpc_open = true +# cmdline opt mapi_port = 38406 +# cmdline opt xrpc_port = 45263 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_src_mal +#warning: please don't forget to set your vault key! +#(see /ufs/mk/Jun2010//Linux/etc/monetdb5.conf) + +# 17:28:20 > +# 17:28:20 > Done. +# 17:28:20 > + diff -r d3b433a65d94 -r b1604d8a3e25 MonetDB5/src/mal/Tests/tst036.stable.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MonetDB5/src/mal/Tests/tst036.stable.out Tue Jul 20 21:47:20 2010 +0200 @@ -0,0 +1,35 @@ +stdout of test 'tst036` in directory 'src/mal` itself: + + +# 17:28:20 > +# 17:28:20 > mserver5 "--config=/ufs/mk/Jun2010//Linux/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/mk/Jun2010//Linux/lib/MonetDB5:/ufs/mk/Jun2010//Linux/lib/MonetDB5/lib:/ufs/mk/Jun2010//Linux/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/mk/Jun2010//Linux/var/MonetDB5/dbfarm" --set mapi_open=true --set xrpc_open=true --set mapi_port=38406 --set xrpc_port=45263 --set monet_prompt= --set mal_listing=2 --trace --dbname=mTests_src_mal tst036.mal +# 17:28:20 > + +# MonetDB server v5.21.0, based on kernel v1.39.0 +# Serving database 'mTests_src_mal', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.751 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved +# Visit http://monetdb.cwi.nl/ for further information +# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:38406/ +# MonetDB/SQL module v2.39.0 loaded +# MonetDB/GIS module v0.19.0 loaded +!TypeException:user.main[6]:Multiple assignment mismatch +!TypeException:user.main[7]:Multiple assignment mismatch +!TypeException:user.main[8]:Multiple assignment mismatch +function user.main():void; +# test for proper use of list assignments + (z0,z1) := (1,"help"); + io.print(z0); + io.print(z1); +# all three are wrong + l1 := (1,2); + (l2,l3) := 3; + (l4,l5) := (4,5,6); +end main; + +# 17:28:20 > +# 17:28:20 > Done. +# 17:28:20 > + diff -r d3b433a65d94 -r b1604d8a3e25 MonetDB5/src/mal/mal_resolve.mx --- a/MonetDB5/src/mal/mal_resolve.mx Tue Jul 20 17:53:13 2010 +0200 +++ b/MonetDB5/src/mal/mal_resolve.mx Tue Jul 20 21:47:20 2010 +0200 @@ -683,7 +683,7 @@ variables. @c if( getFunctionId(p) ) return; - if( p->retc > 1 && p->argc>p->retc && p->argc!= 2 * p->retc){ + if( p->retc >= 1 && p->argc > p->retc && p->argc != 2 * p->retc){ if ( !silent) showScriptException( mb, getPC(mb,p), TYPE, "Multiple assignment mismatch"); _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list