Changeset: fc2716bc5f0d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc2716bc5f0d
Removed Files:
monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows.64bit.oid32
Modified Files:
clients/mapiclient/mclient.c
gdk/gdk_atoms.mx
monetdb5/mal/mal_resolve.c
monetdb5/optimizer/opt_groups.mx
monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows
monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows.64bit.oid64
sql/backends/monet5/UDF/udf.c
sql/backends/monet5/UDF/udf.h
sql/test/bugs/Tests/crash_order_by.stable.out
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/merovingian.c
Branch: jacqueline
Log Message:
Merged from default
diffs (truncated from 3964 to 300 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -656,7 +656,9 @@ CSVrenderer(MapiHdl hdl)
s = mapi_fetch_field(hdl, i);
if (s == NULL)
s = nullstring == default_nullstring ? "" :
nullstring;
- if (strchr(s, *sep) != NULL || strchr(s, '\n') != NULL
|| strchr(s, '"') != NULL) {
+ if (strchr(s, *sep) != NULL ||
+ strchr(s, '\n') != NULL ||
+ strchr(s, '"') != NULL) {
mnstr_printf(toConsole, "%s\"",
i == 0 ? "" : sep);
while (*s) {
@@ -677,8 +679,6 @@ CSVrenderer(MapiHdl hdl)
mnstr_write(toConsole, "\"\"",
1, 2);
break;
default:
- if (*s == *sep)
- mnstr_write(toConsole,
"\\", 1, 1);
mnstr_write(toConsole, s, 1, 1);
break;
}
diff --git a/gdk/gdk_atoms.mx b/gdk/gdk_atoms.mx
--- a/gdk/gdk_atoms.mx
+++ b/gdk/gdk_atoms.mx
@@ -1075,7 +1075,7 @@ static int @1Write(@1 *a, stream *s, siz
@:atomtostr(int,"%d",int)@
@:atom_io(int,Int,int)@
-@:numfromstr(lng,9223372036854775807,SIZEOF_LNG)@
+@:numfromstr(lng,LL_CONSTANT(9223372036854775807),SIZEOF_LNG)@
@:atomtostr(lng,LLFMT,lng)@
@:atom_io(lng,Lng,lng)@
diff --git a/monetdb5/mal/mal_resolve.c b/monetdb5/mal/mal_resolve.c
--- a/monetdb5/mal/mal_resolve.c
+++ b/monetdb5/mal/mal_resolve.c
@@ -68,7 +68,7 @@
* These examples give little room to achieve our prime objective, i.e.
* a fast and early type resolution scheme. Any non-polymorphic function
* can be type checked and marked type-safe upon completion.
- * Type checking polymorphic functions are post-poned until a concrete
+ * Type checking polymorphic functions are postponed until a concrete
* type instance is known. It leads to a clone, which can be type checked
* and is entered into the symbol table.
* The type resolution status is marked in each instruction.
diff --git a/monetdb5/optimizer/opt_groups.mx b/monetdb5/optimizer/opt_groups.mx
--- a/monetdb5/optimizer/opt_groups.mx
+++ b/monetdb5/optimizer/opt_groups.mx
@@ -169,23 +169,74 @@ GRPmulticolumngroup(Client cntxt, MalBlk
{
int *grp = (int*) getArgReference(stk,pci,0);
int *ext = (int*) getArgReference(stk,pci,1);
- int i, newgrp, newext;
+ int i, j, newgrp, newext;
str msg = MAL_SUCCEED;
+ lng *sizes = (lng*) GDKzalloc(sizeof(lng) * pci->argc), l;
+ bat *bid = (bat*) GDKzalloc(sizeof(bat) * pci->argc), bi;
+ BUN *cnt = (BUN*) GDKzalloc(sizeof(BUN) * pci->argc), c;
+ BAT *b, *sample, *uniq;
+
+ for( i=2; i< pci->argc; i++){
+ bid[i] = *(int *) getArgReference(stk, pci, i);
+ b = BATdescriptor(bid[i]);
+ if ( b ){
+ cnt[i]= BATcount(b);
+ sample = BATsample(b,1000);
+ if ( sample) {
+ uniq = BATkunique( BATmirror(sample));
+ if ( uniq){
+ sizes[i] = (lng) BATcount(uniq);
+ BBPreleaseref(uniq->batCacheid);
+ }
+ BBPreleaseref(sample->batCacheid);
+ }
+ BBPreleaseref(bid[i]);
+ }
+ }
+
+ /* for (i=2; i<pci->argc; i++)
+ mnstr_printf(cntxt->fdout,"# before[%d] "LLFMT"\n",i,
sizes[i]); */
+ /* sort order may have influences */
+ /* SF100 Q16 showed < ordering is 2 times faster as > ordering */
+ for ( i = 2; i< pci->argc; i++)
+ for ( j = i+1; j<pci->argc; j++)
+ if ( sizes[j] < sizes[i]){
+ l = sizes[j]; sizes[j]= sizes[i]; sizes[i]= l;
+ bi = bid[j]; bid[j]= bid[i]; bid[i]= bi;
+ c = cnt[j]; cnt[j]= cnt[i]; cnt[i]= c;
+ }
+ /* for (i=2; i<pci->argc; i++)
+ mnstr_printf(cntxt->fdout,"# after [%d] "LLFMT"\n",i,
sizes[i]); */
/* (grp,ext) := group.new(..) */
- msg = GRPgroup(grp, ext, (int*) getArgReference(stk,pci,2));
-
- /* (grp,ext) := group.derive(grp,ext,arg) */
- /* (grp,ext) := group.done(grp,ext,arg) */
- for ( i=3; msg == MAL_SUCCEED && i < pci->argc; i++){
- newgrp= *grp;
- newext= *ext;
- msg = GRPderive(grp, ext, &newgrp, &newext, (int*)
getArgReference(stk,pci,i));
- if ( msg == MAL_SUCCEED){
- BBPdecref(newgrp, TRUE);
- BBPdecref(newext, TRUE);
+ msg = GRPgroup(grp, ext, &bid[2]);
+ /* check group count */
+ b = ( msg == MAL_SUCCEED)? BATdescriptor(*grp): 0;
+ if ( b && BATcount(b) != cnt[2]) {
+ BBPreleaseref(*grp);
+ /* (grp,ext) := group.derive(grp,ext,arg) */
+ /* (grp,ext) := group.done(grp,ext,arg) */
+ for ( i=3; msg == MAL_SUCCEED && i < pci->argc; i++){
+ newgrp= *grp;
+ newext= *ext;
+ msg = GRPderive(grp, ext, &newgrp, &newext, &bid[i]);
+ if ( msg == MAL_SUCCEED){
+ BBPdecref(newgrp, TRUE);
+ BBPdecref(newext, TRUE);
+ }
+ /* check group count */
+ b = BATdescriptor(*grp);
+ if ( b && BATcount(b) == cnt[i]){
+ BBPreleaseref(*grp);
+ break;
+ }
+ BBPreleaseref(*grp);
}
- }
+ } else
+ BBPreleaseref(*grp);
+ GDKfree(sizes);
+ GDKfree(bid);
+ GDKfree(cnt);
(void) cntxt;
(void) mb;
return msg;
diff --git a/monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows
b/monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows
--- a/monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows
+++ b/monetdb5/tests/gdkTests/Tests/casts.stable.out.Windows
@@ -1,18 +1,21 @@
stdout of test 'casts` in directory 'tests/gdkTests` itself:
-# 23:39:53 >
-# 23:39:53 > Mtimeout -timeout 60 mserver5
"--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/dblogs" --set mapi_port=38963
--set monet_prompt= --trace --dbname=mTests_tests_gdkTests casts.mal <
/dev/null
-# 23:39:53 >
+# 10:50:42 >
+# 10:50:42 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=C:\Users\sjoerd\Documents\src\MonetDB\devel\NTv32\var\MonetDB"
"--set" "mapi_open=true" "--set" "mapi_port=38843" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2"
"--dbname=mTests_tests_gdkTests" "casts.mal"
+# 10:50:42 >
-# MonetDB Server v4.99.19
-# Copyright (c) 1993-2006 CWI, all rights reserved
-# Compiled for x86_64-redhat-linux-gnu/64bit with 64bit OIDs dynamically linked
-# config:/ufs/mk/monet5/Linux/etc/MonetDB5.conf
-# dbfarm:/ufs/mk/monet5/Linux/var/MonetDB5/dbfarm
-# dbname:mTests_tests_gdkTests
-# Visit http://monetdb.cwi.nl/ for further information
-# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:30579/
+# MonetDB 5 server v11.10.0 (hg id: c6affd6e5b32)
+# This is an unreleased version
+# Serving database 'mTests_tests_gdkTests', using 4 threads
+# Compiled for i686-pc-winnt/32bit with 32bit OIDs dynamically linked
+# Found 3.991 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://lab03:38843/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
function user.main():void;
io.printf("# casting to int\n");
io.print(0:int);
@@ -45,14 +48,26 @@ function user.main():void;
io.print(2147483647:int);
io.print(-2147483647:int);
i := calc.+(2147483647:int,1:int);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(i);
z := calc.-(-2147483647:int,1:int);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(z);
io.printf("# should this produce nil (overflow)?\n");
z := calc.+(2147483647:int,2:int);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(z);
io.printf("# should this produce nil (overflow)?\n");
z := calc.-(-2147483647:int,2:int);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(z);
io.printf("# int from lng\n");
io.print(1:int);
@@ -105,10 +120,10 @@ function user.main():void;
io.print(32767:int);
io.print(2147483647:int);
io.print(nil:int);
- io.print(nil:int);
+ io.print(-2147483647:int);
io.print(-2147483647:int);
io.print(nil:int);
- io.print(nil:int);
+ io.print(2147483647:int);
io.print(nil:int);
io.print(nil:int);
io.printf("# to bit\n");
@@ -229,10 +244,10 @@ function user.main():void;
io.print(0:sht);
io.print(32767:sht);
io.print(nil:sht);
- io.print(nil:sht);
+ io.print(-32767:sht);
io.print(-32767:sht);
io.print(nil:sht);
- io.print(nil:sht);
+ io.print(32767:sht);
io.print(nil:sht);
io.print(nil:sht);
io.printf("# to long\n");
@@ -249,10 +264,10 @@ function user.main():void;
io.print(-2147483649:lng);
io.print(9223372036854775807:lng);
io.print(nil:lng);
- io.print(nil:lng);
+ io.print(-9223372036854775807:lng);
io.print(-9223372036854775807:lng);
io.print(nil:lng);
- io.print(nil:lng);
+ io.print(9223372036854775807:lng);
io.printf("# lng from bit\n");
io.print(1:lng);
io.print(0:lng);
@@ -270,16 +285,28 @@ function user.main():void;
io.print(2147483647:lng);
io.print(-2147483647:lng);
lz := calc.+(2147483647,1);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
l := calc.lng(lz);
io.print(l);
lu := calc.-(-2147483647,1);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
l := calc.lng(lu);
io.print(l);
io.printf("# should this produce nil (overflow)?\n");
la := calc.+(2147483647,2);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(la);
io.printf("# should this produce nil (overflow)?\n");
lb := calc.-(-2147483647,2);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
io.print(lb);
io.printf("# lng from lng\n");
io.printf("# lng from flt\n");
@@ -348,10 +375,10 @@ function user.main():void;
io.print(nil:lng);
io.print(9223372036854775807:lng);
io.print(nil:lng);
- io.print(nil:lng);
+ io.print(-9223372036854775807:lng);
io.print(-9223372036854775807:lng);
io.print(nil:lng);
- io.print(nil:lng);
+ io.print(9223372036854775807:lng);
io.printf("# to flt\n");
io.printf("# flt from bit\n");
io.print(1:flt);
@@ -370,17 +397,29 @@ function user.main():void;
io.print(2.14748365e+009:flt);
io.print(-2.14748365e+009:flt);
fl := calc.+(2147483647,1);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
f := calc.flt(fl);
io.print(f);
fi := calc.-(-2147483647,1);
+catch MALException:str ;
+ io.printf("Caught exception\n");
+exit MALException:str ;
f := calc.flt(fi);
io.print(f);
io.printf("# should this produce nil (overflow)?\n");
- ff := calc.+(2147483647,1);
+ ff := calc.+(2147483647,2);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list