Changeset: 99c0c15daf3f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99c0c15daf3f Modified Files: sql/backends/monet5/UDF/udf.c sql/backends/monet5/UDF/udf.h sql/backends/monet5/UDF/udf_impl.h sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err.Windows Branch: ssdb Log Message:
Merge with Feb2013 branch. diffs (285 lines): diff --git a/sql/backends/monet5/UDF/udf.c b/sql/backends/monet5/UDF/udf.c --- a/sql/backends/monet5/UDF/udf.c +++ b/sql/backends/monet5/UDF/udf.c @@ -25,11 +25,11 @@ /* actual implementation */ /* all non-exported functions must be declared static */ -static str -UDFreverse_(str *ret, str src) +static char * +UDFreverse_(char **ret, const char *src) { size_t len = 0; - str dst = NULL; + char *dst = NULL; /* assert calling sanity */ assert(ret != NULL); @@ -60,8 +60,8 @@ UDFreverse_(str *ret, str src) } /* MAL wrapper */ -str -UDFreverse(str *ret, str *arg) +char * +UDFreverse(char **ret, const char **arg) { /* assert calling sanity */ assert(ret != NULL && arg != NULL); @@ -77,8 +77,8 @@ UDFreverse(str *ret, str *arg) */ /* actual implementation */ -static str -UDFBATreverse_(BAT **ret, BAT *left) +static char * +UDFBATreverse_(BAT **ret, BAT *src) { BATiter li; BAT *bn = NULL; @@ -88,32 +88,32 @@ UDFBATreverse_(BAT **ret, BAT *left) assert(ret != NULL); /* handle NULL pointer */ - if (left == NULL) + if (src == NULL) throw(MAL, "batudf.reverse", RUNTIME_OBJECT_MISSING); /* check tail type */ - if (left->ttype != TYPE_str) { + if (src->ttype != TYPE_str) { throw(MAL, "batudf.reverse", "tail-type of input BAT must be TYPE_str"); } /* allocate result BAT */ - bn = BATnew(left->htype, TYPE_str, BATcount(left)); + bn = BATnew(src->htype, TYPE_str, BATcount(src)); if (bn == NULL) { throw(MAL, "batudf.reverse", MAL_MALLOC_FAIL); } - BATseqbase(bn, left->hseqbase); + BATseqbase(bn, src->hseqbase); /* create BAT iterator */ - li = bat_iterator(left); + li = bat_iterator(src); /* the core of the algorithm, expensive due to malloc/frees */ - BATloop(left, p, q) { - str tr = NULL, err = NULL; + BATloop(src, p, q) { + char *tr = NULL, *err = NULL; /* get original head & tail value */ ptr h = BUNhead(li, p); - str t = (str) BUNtail(li, p); + const char *t = (const char *) BUNtail(li, p); /* revert tail value */ err = UDFreverse_(&tr, t); @@ -140,24 +140,24 @@ UDFBATreverse_(BAT **ret, BAT *left) } /* MAL wrapper */ -str -UDFBATreverse(bat *ret, bat *bid) +char * +UDFBATreverse(bat *ret, const bat *arg) { - BAT *res = NULL, *left = NULL; - str msg = NULL; + BAT *res = NULL, *src = NULL; + char *msg = NULL; /* assert calling sanity */ - assert(ret != NULL && bid != NULL); + assert(ret != NULL && arg != NULL); /* bat-id -> BAT-descriptor */ - if ((left = BATdescriptor(*bid)) == NULL) + if ((src = BATdescriptor(*arg)) == NULL) throw(MAL, "batudf.reverse", RUNTIME_OBJECT_MISSING); /* do the work */ - msg = UDFBATreverse_ ( &res, left ); + msg = UDFBATreverse_ ( &res, src ); /* release input BAT-descriptor */ - BBPreleaseref(left->batCacheid); + BBPreleaseref(src->batCacheid); if (msg == MAL_SUCCEED) { /* register result BAT in buffer pool */ @@ -200,14 +200,14 @@ UDFBATreverse(bat *ret, bat *bid) /* BAT fuse */ /* actual implementation */ -static str -UDFBATfuse_(BAT **ret, BAT *bone, BAT *btwo) +static char * +UDFBATfuse_(BAT **ret, const BAT *bone, const BAT *btwo) { BAT *bres = NULL; bit two_tail_sorted_unsigned = FALSE; bit two_tail_revsorted_unsigned = FALSE; BUN n; - str msg = NULL; + char *msg = NULL; /* assert calling sanity */ assert(ret != NULL); @@ -309,11 +309,11 @@ UDFBATfuse_(BAT **ret, BAT *bone, BAT *b } /* MAL wrapper */ -str -UDFBATfuse(bat *ires, bat *ione, bat *itwo) +char * +UDFBATfuse(bat *ires, const bat *ione, const bat *itwo) { BAT *bres = NULL, *bone = NULL, *btwo = NULL; - str msg = NULL; + char *msg = NULL; /* assert calling sanity */ assert(ires != NULL && ione != NULL && itwo != NULL); diff --git a/sql/backends/monet5/UDF/udf.h b/sql/backends/monet5/UDF/udf.h --- a/sql/backends/monet5/UDF/udf.h +++ b/sql/backends/monet5/UDF/udf.h @@ -40,16 +40,16 @@ /* export MAL wrapper functions */ -udf_export str UDFreverse(str *ret, str *src); -udf_export str UDFBATreverse(int *ret, int *bid); +udf_export char * UDFreverse(char **ret, const char **arg); +udf_export char * UDFBATreverse(bat *ret, const bat *arg); /* using C macro for convenient type-expansion */ #define UDFfuse_scalar_decl(in,out) \ - udf_export str UDFfuse_##in##_##out(out *ret, in *one, in *two) + udf_export char * UDFfuse_##in##_##out(out *ret, const in *one, const in *two) UDFfuse_scalar_decl(bte, sht); UDFfuse_scalar_decl(sht, int); UDFfuse_scalar_decl(int, lng); -udf_export str UDFBATfuse(bat *ret, bat *one, bat *two); +udf_export char * UDFBATfuse(bat *ret, const bat *one, const bat *two); #endif /* _SQL_UDF_H_ */ diff --git a/sql/backends/monet5/UDF/udf_impl.h b/sql/backends/monet5/UDF/udf_impl.h --- a/sql/backends/monet5/UDF/udf_impl.h +++ b/sql/backends/monet5/UDF/udf_impl.h @@ -38,7 +38,7 @@ /* fuse two (shift-byte) in values into one (2*shift-byte) out value */ /* actual implementation */ -static str +static char * UF(UDFfuse_,UI,UO,_) ( UO *ret , UI one , UI two ) { int shift = sizeof(UI) * 8; @@ -56,8 +56,8 @@ UF(UDFfuse_,UI,UO,_) ( UO *ret , UI one return MAL_SUCCEED; } /* MAL wrapper */ -str -UF(UDFfuse_,UI,UO,) ( UO *ret , UI *one , UI *two ) +char * +UF(UDFfuse_,UI,UO,) ( UO *ret , const UI *one , const UI *two ) { /* assert calling sanity */ assert(ret != NULL && one != NULL && two != NULL); @@ -72,8 +72,8 @@ UF(UDFfuse_,UI,UO,) ( UO *ret , UI *one */ /* type-specific core algorithm */ -static str -UF(UDFBATfuse_,UI,UO,) ( BAT *bres, BAT *bone, BAT *btwo, BUN n, +static char * +UF(UDFBATfuse_,UI,UO,) ( const BAT *bres, const BAT *bone, const BAT *btwo, BUN n, bit *two_tail_sorted_unsigned, bit *two_tail_revsorted_unsigned ) { diff --git a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err.Windows b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err.Windows --- a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err.Windows +++ b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err.Windows @@ -5,75 +5,15 @@ stderr of test 'select_from_env.SF-12407 # 13:22:15 > Mtimeout -timeout 180 Mserver "--config=/ufs/sjoerd/Monet-virgin/etc/MonetDB.conf" --debug=10 --set "monet_mod_path=/ufs/sjoerd/src/MonetDB/devel/sql-virgin/Linux/lib/MonetDB:/ufs/sjoerd/Monet-virgin/lib/MonetDB" --set "gdk_dbfarm=/ufs/sjoerd/Monet-virgin/var/MonetDB/dbfarm" --set "sql_logdir=/ufs/sjoerd/Monet-virgin/var/MonetDB/log" --set mapi_port=30620 --set sql_port=47090 --set xquery_port=50410 --set monet_prompt= --trace "--dbname=mTests_src_test_BugDay_2005-12-19_2.9.3" --dbinit="module(sql_server); sql_server_start();" ; echo ; echo Over.. # 13:22:15 > -# builtin opt gdk_arch = 64bitx86_64-pc-solaris2.11 -# builtin opt gdk_version = 1.33.0 -# builtin opt prefix = /export/scratch/stripe/fabian/monetdb/current/program-i86pc -# builtin opt exec_prefix = ${prefix} -# builtin opt gdk_dbname = tst -# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB -# builtin opt gdk_debug = 8 -# builtin opt gdk_alloc_map = yes -# builtin opt gdk_vmtrim = yes -# builtin opt monet_admin = adm -# builtin opt monet_prompt = > -# builtin opt monet_welcome = yes -# builtin opt monet_mod_path = /export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB -# builtin opt monet_daemon = yes -# builtin opt host = localhost -# builtin opt mapi_port = 50000 -# builtin opt mapi_noheaders = no -# builtin opt mapi_debug = 0 -# builtin opt mapi_clients = 2 -# builtin opt sql_debug = 0 -# builtin opt standoff_ns = http://monetdb.cwi.nl/standoff -# builtin opt standoff_start = start -# builtin opt standoff_end = end -# config opt prefix = /export/scratch/stripe/fabian/monetdb/current/program-i86pc -# config opt config = ${prefix}/etc/monetdb5.conf -# config opt prefix = /export/scratch/stripe/fabian/monetdb/current/program-i86pc -# config opt exec_prefix = ${prefix} -# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm -# config opt gdk_dbname = demo -# config opt gdk_alloc_map = no -# config opt gdk_embedded = no -# config opt gdk_debug = 0 -# config opt monet_mod_path = /export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5:/export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5/lib:/export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5/bin -# config opt monet_daemon = no -# config opt monet_welcome = yes -# config opt mero_msglog = ${prefix}/var/log/MonetDB/merovingian.log -# config opt mero_errlog = ${prefix}/var/log/MonetDB/merovingian.log -# config opt mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid -# config opt mero_controlport = 50001 -# config opt mal_init = /export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5/mal_init.mal -# config opt mal_listing = 2 -# config opt mapi_port = 50000 -# config opt mapi_autosense = false -# config opt mapi_open = false -# config opt sql_optimizer = inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,garbageCollector,dataflow,history,replication,multiplex -# cmdline opt config = /export/scratch/stripe/fabian/monetdb/current/program-i86pc/etc/monetdb5.conf -# cmdline opt gdk_nr_threads = 0 -# cmdline opt monet_mod_path = /export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5:/export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5/lib:/export/scratch/stripe/fabian/monetdb/current/program-i86pc/lib/MonetDB5/bin -# cmdline opt gdk_dbfarm = /export/scratch/stripe/fabian/monetdb/current/mtest-pegasus.ins.cwi.nl/sql/dbfarm -# cmdline opt mapi_open = true -# cmdline opt xrpc_open = true -# cmdline opt mapi_port = 30332 -# cmdline opt xrpc_port = 44644 -# cmdline opt monet_prompt = -# cmdline opt gdk_dbname = mTests_src_test_BugDay_2005-12-19_2.9.3 -# cmdline opt mal_listing = 0 -#warning: please don't forget to set your vault key! -#(see /export/scratch/stripe/fabian/monetdb/current/program-i86pc/etc/monetdb5.conf) # 22:29:10 > # 22:29:10 > mclient -lsql -i -umonetdb -Pmonetdb --host=pegasus --port=30332 # 22:29:10 > -MAPI = (monetdb) /var/tmp/mtest-29744/.s.monetdb.36963 +MAPI = (monetdb) /var/tmp/mtest-23209/.s.monetdb.33225 QUERY = select * from env() as env where name = ( select 'prefix' from env() as env ); ERROR = !cardinality violation (20>1) - - # 13:22:15 > # 13:22:15 > Done. # 13:22:15 > _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list