Changeset: 09bbace88c29 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09bbace88c29 Modified Files: monetdb5/modules/mal/Tests/All monetdb5/modules/mal/Tests/remote09.mal monetdb5/modules/mal/Tests/remote09.stable.err monetdb5/modules/mal/Tests/remote09.stable.out monetdb5/modules/mal/remote.mx Branch: default Log Message:
remote.get: set width of values for strings Since strings have variable width of offset pointers, we need to make sure we use the same width as what we copied from the remote side, or we'll get odd/weird results (and crashes). diffs (196 lines): diff --git a/monetdb5/modules/mal/Tests/All b/monetdb5/modules/mal/Tests/All --- a/monetdb5/modules/mal/Tests/All +++ b/monetdb5/modules/mal/Tests/All @@ -33,6 +33,7 @@ remote04 remote06 remote08 +remote09 # needs Merovingian and aims at SQL #remote88 #remote89 diff --git a/monetdb5/modules/mal/Tests/remote09.mal b/monetdb5/modules/mal/Tests/remote09.mal new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/remote09.mal @@ -0,0 +1,42 @@ +# let connect figure out itself how to connect to the running db +uri := sabaoth.getLocalConnectionURI(); + +# create a persistent connecton to ourself +conn1:str := remote.connect(uri, "monetdb", "monetdb"); + +b := bat.new(:oid, :str); + +b := bat.insert(b, nil:oid, "maandag"); +b := bat.insert(b, nil:oid, "dinsdag"); +b := bat.insert(b, nil:oid, "woensdag"); +b := bat.insert(b, nil:oid, "donderdag"); +b := bat.insert(b, nil:oid, "vrijdag"); +b := bat.insert(b, nil:oid, "januari"); +b := bat.insert(b, nil:oid, "februari"); +b := bat.insert(b, nil:oid, "maart"); +b := bat.insert(b, nil:oid, "april"); +b := bat.insert(b, nil:oid, "mei"); +b := bat.insert(b, nil:oid, "juni"); +b := bat.insert(b, nil:oid, "juli"); +b := bat.insert(b, nil:oid, "augustus"); +b := bat.insert(b, nil:oid, "september"); +b := bat.insert(b, nil:oid, "oktober"); +b := bat.insert(b, nil:oid, "november"); +b := bat.insert(b, nil:oid, "december"); +b := bat.insert(b, nil:oid, "morgen"); +b := bat.insert(b, nil:oid, "middag"); +b := bat.insert(b, nil:oid, "avond"); +b := bat.insert(b, nil:oid, "nacht"); +b := bat.insert(b, nil:oid, "licht"); +b := bat.insert(b, nil:oid, "duisternis"); + +b := algebra.markH(b); + +rb2 := remote.put(conn1, b); +lb2:bat[:oid,:str] := remote.get(conn1, rb2); + +io.print(lb2); + +# help testweb a bit, since currently no cleanup is done on server +# shutdown +remote.disconnect(conn1); diff --git a/monetdb5/modules/mal/Tests/remote09.stable.err b/monetdb5/modules/mal/Tests/remote09.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/remote09.stable.err @@ -0,0 +1,31 @@ +stderr of test 'remote09` in directory 'modules/mal` itself: + + +# 15:38:56 > +# 15:38:56 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-current-volund.ins.cwi.nl/five/dbfarm" --set mapi_open=true --set mapi_port=32448 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal remote09.mal +# 15:38:56 > + +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = /ufs/fabian/scratch/monetdb/current/program-x86_64/var/lib/monetdb5/dbfarm +# builtin opt gdk_debug = 0 +# builtin opt gdk_alloc_map = no +# builtin opt gdk_vmtrim = yes +# 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 gdk_dbfarm = /net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-current-volund.ins.cwi.nl/five/dbfarm +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 32448 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_modules_mal + +# 15:38:57 > +# 15:38:57 > Done. +# 15:38:57 > + diff --git a/monetdb5/modules/mal/Tests/remote09.stable.out b/monetdb5/modules/mal/Tests/remote09.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/remote09.stable.out @@ -0,0 +1,86 @@ +stdout of test 'remote09` in directory 'modules/mal` itself: + + +# 15:38:56 > +# 15:38:56 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-current-volund.ins.cwi.nl/five/dbfarm" --set mapi_open=true --set mapi_port=32448 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal remote09.mal +# 15:38:56 > + +# MonetDB 5 server v11.4.0 "current-a384b06d6f96" +# Serving database 'mTests_modules_mal', using 4 threads +# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.749 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved +# Visit http://monetdb.cwi.nl/ for further information +# Listening for connection requests on mapi:monetdb://volund.ins.cwi.nl:32448/ +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +function user.main():void; +# let connect figure out itself how to connect to the running db + uri := sabaoth.getLocalConnectionURI(); +# create a persistent connecton to ourself + conn1:str := remote.connect(uri,"monetdb","monetdb"); + b := bat.new(:oid,:str); + b := bat.insert(b,nil:oid,"maandag"); + b := bat.insert(b,nil:oid,"dinsdag"); + b := bat.insert(b,nil:oid,"woensdag"); + b := bat.insert(b,nil:oid,"donderdag"); + b := bat.insert(b,nil:oid,"vrijdag"); + b := bat.insert(b,nil:oid,"januari"); + b := bat.insert(b,nil:oid,"februari"); + b := bat.insert(b,nil:oid,"maart"); + b := bat.insert(b,nil:oid,"april"); + b := bat.insert(b,nil:oid,"mei"); + b := bat.insert(b,nil:oid,"juni"); + b := bat.insert(b,nil:oid,"juli"); + b := bat.insert(b,nil:oid,"augustus"); + b := bat.insert(b,nil:oid,"september"); + b := bat.insert(b,nil:oid,"oktober"); + b := bat.insert(b,nil:oid,"november"); + b := bat.insert(b,nil:oid,"december"); + b := bat.insert(b,nil:oid,"morgen"); + b := bat.insert(b,nil:oid,"middag"); + b := bat.insert(b,nil:oid,"avond"); + b := bat.insert(b,nil:oid,"nacht"); + b := bat.insert(b,nil:oid,"licht"); + b := bat.insert(b,nil:oid,"duisternis"); + b := algebra.markH(b); + rb2 := remote.put(conn1,b); + lb2:bat[:oid,:str] := remote.get(conn1,rb2); + io.print(lb2); +# help testweb a bit, since currently no cleanup is done on server +# shutdown + remote.disconnect(conn1); +end main; +#-------------------------# +# h t # name +# void str # type +#-------------------------# +[ 0@0, "maandag" ] +[ 1@0, "dinsdag" ] +[ 2@0, "woensdag" ] +[ 3@0, "donderdag" ] +[ 4@0, "vrijdag" ] +[ 5@0, "januari" ] +[ 6@0, "februari" ] +[ 7@0, "maart" ] +[ 8@0, "april" ] +[ 9@0, "mei" ] +[ 10@0, "juni" ] +[ 11@0, "juli" ] +[ 12@0, "augustus" ] +[ 13@0, "september" ] +[ 14@0, "oktober" ] +[ 15@0, "november" ] +[ 16@0, "december" ] +[ 17@0, "morgen" ] +[ 18@0, "middag" ] +[ 19@0, "avond" ] +[ 20@0, "nacht" ] +[ 21@0, "licht" ] +[ 22@0, "duisternis" ] + +# 15:38:57 > +# 15:38:57 > Done. +# 15:38:57 > + diff --git a/monetdb5/modules/mal/remote.mx b/monetdb5/modules/mal/remote.mx --- a/monetdb5/modules/mal/remote.mx +++ b/monetdb5/modules/mal/remote.mx @@ -1320,6 +1320,7 @@ /* the BAT we will return */ b = BATnew(bb.Htype, bb.Ttype, bb.size); b->hseqbase = bb.seqbase; + b->T->width = bb.tailsize / bb.size; mnstr_read(in, b->T->heap.base, bb.tailsize, 1); b->batCount = bb.size; _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
