Changeset: 4fcc9b8dbc36 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4fcc9b8dbc36
Modified Files:
        monetdb5/mal/Tests/tst605.mal
        monetdb5/mal/Tests/tst605.stable.out
        monetdb5/mal/Tests/tst607.mal
        monetdb5/mal/Tests/tst607.stable.out
        monetdb5/modules/mal/const.c
Branch: Oct2012
Log Message:

const: drop invalid entries

config is always NULL, most likely the cause for endless printing time
(Timeout) on some platforms due to invalid NULL/nil mapping.
user is always 0, and hence not of any use

Fix tests to do less useless things


diffs (216 lines):

diff --git a/monetdb5/mal/Tests/tst605.mal b/monetdb5/mal/Tests/tst605.mal
--- a/monetdb5/mal/Tests/tst605.mal
+++ b/monetdb5/mal/Tests/tst605.mal
@@ -1,14 +1,3 @@
-# Testing global consts defined for all users
-# It should traverse the nested spaces looking for the correct variable
-# take a local copy
-       version:str := const.take("version");
-       user:str := const.take("user");
-       dbname:str:= const.take("dbname");
-       dbfarm:str:= const.take("dbfarm");
-#      dd:str:= const.take(distribution);
-#      bb:bat[void,str] := const.take(environment);
-
-# how to obtain a copy of all objects in a space?
 io.print("Contents of the 'const' box");
 barrier (b,nme):= const.newIterator();
        io.printf("# %s=",nme);
diff --git a/monetdb5/mal/Tests/tst605.stable.out 
b/monetdb5/mal/Tests/tst605.stable.out
--- a/monetdb5/mal/Tests/tst605.stable.out
+++ b/monetdb5/mal/Tests/tst605.stable.out
@@ -1,47 +1,23 @@
 stdout of test 'tst605` in directory 'mal` itself:
 
 
-# 08:01:24 >  
-# 08:01:24 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/Linux/etc/MonetDB5.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/monet5/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/monet5/Linux/var/MonetDB5/log" --set mapi_port=42158 --set 
sql_port=55708 --set monet_prompt= --trace 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --dbname=mTests_src_mal  
tst605.mal </dev/null
-# 08:01:24 >  
+# 14:52:15 >  
+# 14:52:15 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-Oct2012-sofia.ins.cwi.nl/five/dbfarm"
 "--set" "mapi_open=true" "--set" "mapi_port=39412" "--set" "monet_prompt=" 
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_mal" 
"tst605.mal"
+# 14:52:15 >  
 
-# Monet Database Server V4.99.19
-# Copyright (c) 1993-2004, CWI. All rights reserved.
-# Compiled for i686-redhat-linux-gnu/32bit; dynamically linked.
-# config:/ufs/mk/monet5/Linux/etc/MonetDB5.conf
-# dbfarm:/ufs/mk/monet5/Linux/var/MonetDB5/dbfarm
-# dbname:mTests_src_mal
-# Visit http://monetdb.cwi.nl/ for further information.
-## Testing global consts defined for all users
-## It should travers the nested spaces looking for the correct variable
-## take a local copy
-#      v:str := const.take(version);
-#      u:str := const.take(user);
-#      db:str:= const.take(dbname);
-#      df:str:= const.take(dbfarm);
-##     dd:str:= const.take(distribution);
-##     bb:bat[void,str] := const.take(environment);
-#
-## how to obtain a copy of all objects in a space?
-#print("Contents of the 'const' box");
-#barrier (b,nme):= const.newIterator();
-#      printf("# %s=",nme);
-#      val:str := const.toString(nme);
-#      printf("%s\n",val);
-#      redo (b,nme):= const.hasMoreElements();
-#exit b;
-#
+# MonetDB 5 server v11.13.0 "Oct2012-b3df9ec1a3e0+"
+# Serving database 'mTests_mal', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked
+# Found 15.629 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://sofia.ins.cwi.nl:39412/
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+# MonetDB/DataCell loaded
 function user.main():void;
-# Testing global consts defined for all users 
-# It should traverse the nested spaces looking for the correct variable 
-# take a local copy 
-    version:str  := const.take("version");
-    user:str  := const.take("user");
-    dbname:str  := const.take("dbname");
-    dbfarm:str  := const.take("dbfarm");
-#      dd:str:= const.take(distribution); 
-#      bb:bat[void,str] := const.take(environment); 
-# how to obtain a copy of all objects in a space? 
     io.print("Contents of the 'const' box");
 barrier (b,nme) := const.newIterator();
     io.printf("# %s=",nme);
@@ -51,14 +27,12 @@ barrier (b,nme) := const.newIterator();
 exit b;
 end main;
 [ "Contents of the 'const' box" ]
-# user=Admin
-# dbname=mTests_src_mal
-# dbfarm=/ufs/mk/monet5/Linux/var/MonetDB5/dbfarm
-# version=4.99.19
-# config=nil
-# pi=3.14700007
+# dbname=mTests_mal
+# 
dbfarm=/net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-Oct2012-sofia.ins.cwi.nl/five/dbfarm
+# version=11.13.0
+# gdk_version=11.13.0
 
-# 08:01:24 >  
-# 08:01:24 >  Done.
-# 08:01:24 >  
+# 14:52:15 >  
+# 14:52:15 >  "Done."
+# 14:52:15 >  
 
diff --git a/monetdb5/mal/Tests/tst607.mal b/monetdb5/mal/Tests/tst607.mal
--- a/monetdb5/mal/Tests/tst607.mal
+++ b/monetdb5/mal/Tests/tst607.mal
@@ -1,7 +1,5 @@
 # using spaces
 
-u:str:=const.take("user");
-io.printf("#User bound to %s\n",u);
 roomnumber:= 321;
 const.deposit("roomnumber",roomnumber);
 
diff --git a/monetdb5/mal/Tests/tst607.stable.out 
b/monetdb5/mal/Tests/tst607.stable.out
--- a/monetdb5/mal/Tests/tst607.stable.out
+++ b/monetdb5/mal/Tests/tst607.stable.out
@@ -1,36 +1,24 @@
 stdout of test 'tst607` in directory 'mal` itself:
 
 
-# 13:31:54 >  
-# 13:31:54 >  Mtimeout -timeout 60 Mserver 
"--config=/ufs/mk/monet5/src/mal/Tests/All.conf" --debug=10 --set 
"monet_mod_path=/ufs/mk/monet5/Linux/lib/MonetDB5:/ufs/mk/opensource/MonetDB/Linux/lib/MonetDB"
 --set "gdk_dbfarm=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm" --set 
"sql_logdir=/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/log" --set 
mapi_port=32003 --set sql_port=41971 --set xquery_port=59185 --set 
monet_prompt= --trace "--config=/ufs/mk/monet5/src/mal/Tests/All.conf" 
--dbname=mTests_src_mal  tst607.mal < /dev/null
-# 13:31:54 >  
+# 14:53:38 >  
+# 14:53:38 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/net/sofia.ins.cwi.nl/export/scratch1/fabian/tmp/mtest-Oct2012-sofia.ins.cwi.nl/five/dbfarm"
 "--set" "mapi_open=true" "--set" "mapi_port=30254" "--set" "monet_prompt=" 
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_mal" 
"tst607.mal"
+# 14:53:38 >  
 
-# Monet Database Server V4.99.19
-# Copyright (c) 1993-2005, CWI. All rights reserved.
-# Compiled for x86_64-redhat-linux-gnu/64bit with 32bit OIDs; dynamically 
linked.
-# config:/ufs/mk/monet5/src/mal/Tests/All.conf
-# dbfarm:/ufs/mk/opensource/MonetDB/Linux/var/MonetDB5/dbfarm
-# dbname:mTests_src_mal
-# Visit http://monetdb.cwi.nl/ for further information.
-## using spaces
-#
-#u:str:=const.take("user");
-#io.printf("User bound to %s\n",u);
-#roomnumber:= 321;
-#const.deposit("roomnumber",roomnumber);
-#
-#v:int:= const.take("roomnumber");
-#io.print(v);
-#v:= 123;
-#v:= v+1;
-#const.release("roomnumber");
-#io.print("attempt twice to release");
-#const.release("roomnumber"); # failure? done twice or implicit take?
-#
+# MonetDB 5 server v11.13.0 "Oct2012-b3df9ec1a3e0+"
+# Serving database 'mTests_mal', using 8 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked
+# Found 15.629 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://sofia.ins.cwi.nl:30254/
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+# MonetDB/DataCell loaded
 function user.main():void;
 # using spaces 
-    u:str  := const.take("user");
-    io.printf("#User bound to %s\n",u);
     roomnumber := 321;
     const.deposit("roomnumber",roomnumber);
     v:int  := const.take("roomnumber");
@@ -42,11 +30,10 @@ function user.main():void;
     const.release("roomnumber");
 # failure? done twice or implicit take? 
 end main;
-#User bound to 0
 [ 321 ]
 [ "attempt twice to release" ]
 
-# 13:31:54 >  
-# 13:31:54 >  Done.
-# 13:31:54 >  
+# 14:53:38 >  
+# 14:53:38 >  "Done."
+# 14:53:38 >  
 
diff --git a/monetdb5/modules/mal/const.c b/monetdb5/modules/mal/const.c
--- a/monetdb5/modules/mal/const.c
+++ b/monetdb5/modules/mal/const.c
@@ -61,6 +61,7 @@ str
 CSTprelude(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        Box box;
+       char u[24];
 
        (void) cntxt;
        (void) mb;
@@ -72,17 +73,11 @@ CSTprelude(Client cntxt, MalBlkPtr mb, M
                throw(MAL, "const.prelude", BOX_CLOSED);
        /* if the box was already filled we can skip initialization */
        if (box->sym->vtop == 0) {
-               char u[24 + 1];
-               snprintf(u, 24, OIDFMT, cntxt->user);
-               u[24] = '\0';
-               insertToBox(box, "user", u);
                insertToBox(box, "dbname", GDKgetenv("gdk_dbname"));
                insertToBox(box, "dbfarm", GDKgetenv("gdk_dbfarm"));
                insertToBox(box, "version", VERSION);
                snprintf(u, 24, "%s", GDKversion());
                insertToBox(box, "gdk_version", u);
-               insertToBox(box, "config", GDKgetenv("gdk_config"));
-               /* old bat.mx and algebra.mx constants */
        }
        return MAL_SUCCEED;
 }
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to