Changeset: a56a7514d42a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a56a7514d42a
Modified Files:
        monetdb5/optimizer/Tests/dataflow.timeout
        sql/server/rel_optimizer.c
Branch: default
Log Message:

Merge with Aug2011 branch.


diffs (202 lines):

diff --git a/monetdb5/optimizer/Tests/dataflow.mal 
b/monetdb5/optimizer/Tests/dataflow.mal
--- a/monetdb5/optimizer/Tests/dataflow.mal
+++ b/monetdb5/optimizer/Tests/dataflow.mal
@@ -1,23 +1,14 @@
 # a simple dataflow test
 
-function slow():bat[:oid,:dbl];
-b:= bat.new(:oid,:dbl);
-barrier (go,i):= language.newRange(0:lng);
-       f:= calc.dbl(i);
-       k:= mmath.sin(f);
-       bat.insert(b,nil:oid,k);
-       redo (go,i):= language.nextElement(1:lng,10000000:lng);
-exit (go,i);
-       return b;
-end slow;
+include microbenchmark;
 
 function tst();
-s:= slow();
+s:= microbenchmark.uniform(0:oid, 10000000, 10000000);
 l:= aggr.min(s);
 h:= l;
 #mdb.setTimer(true);
 #mdb.setThread(true);
-z:= nil:bat[:oid,:dbl];
+z:= nil:bat[:oid,:int];
 barrier go:= language.dataflow();
        t1:= algebra.select(s,l,h);
        t2:= algebra.select(s,l,h);
diff --git a/monetdb5/optimizer/Tests/dataflow.stable.out 
b/monetdb5/optimizer/Tests/dataflow.stable.out
--- a/monetdb5/optimizer/Tests/dataflow.stable.out
+++ b/monetdb5/optimizer/Tests/dataflow.stable.out
@@ -18,23 +18,13 @@ stdout of test 'dataflow` in directory '
 # MonetDB/SQL module loaded
 # MonetDB/DataCell module not loaded
 # SQLException:mvc:SQL module not initialized
-function user.slow():bat[:oid,:dbl];
-    b := bat.new(:oid,:dbl);
-barrier (go,i) := language.newRange(0:lng);
-    f := calc.dbl(i);
-    k := mmath.sin(f);
-    bat.insert(b,nil:oid,k);
-    redo (go,i) := language.nextElement(1:lng,10000000:lng);
-exit (go,i);
-    return slow := b;
-end slow;
 function user.tst():void;
-    s := user.slow();
+    s := microbenchmark.uniform(0@0:oid,10000000,10000000);
     l := aggr.min(s);
     h := l;
 #mdb.setTimer(true); 
 #mdb.setThread(true); 
-    z := nil:bat[:oid,:dbl];
+    z := nil:bat[:oid,:int];
 barrier go := language.dataflow();
     t1 := algebra.select(s,l,h);
     t2 := algebra.select(s,l,h);
@@ -57,28 +47,28 @@ function user.main():void;
     user.tst();
 end main;
 function user.tst():void;               #  0 tst:void := user.tst() {G}
-    s := user.slow();                   #  1 s:bat[:oid,:dbl] := user.slow() 
{G}
-    l := aggr.min(s);                   #  2 l:dbl := 
ALGmin_dbl(s:bat[:oid,:dbl]) {G}
-    h := l;                             #  3 h:dbl := l:dbl 
+    s := microbenchmark.uniform(0@0:oid,10000000,10000000);#  1 
s:bat[:oid,:int] := MBMuniform(_2:oid, _3:int, _3:int) {G}
+    l := aggr.min(s);                   #  2 l:int := 
ALGmin_int(s:bat[:oid,:int]) {G}
+    h := l;                             #  3 h:int := l:int 
 #mdb.setTimer(true); 
 #mdb.setThread(true); 
-    z := nil:bat[:oid,:dbl];            #  6 z:bat[:oid,:dbl] := 
_7:bat[:oid,:dbl] {G}
+    z := nil:bat[:oid,:int];            #  6 z:bat[:oid,:int] := 
_9:bat[:oid,:int] {G}
 barrier go := language.dataflow();      #  7 go:int := MALstartDataflow() {J17}
-    t1 := algebra.select(s,l,h);        #  8 t1:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t2 := algebra.select(s,l,h);        #  9 t2:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t3 := algebra.select(s,l,h);        # 10 t3:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t4 := algebra.select(s,l,h);        # 11 t4:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t5 := algebra.select(s,l,h);        # 12 t5:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t6 := algebra.select(s,l,h);        # 13 t6:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t7 := algebra.select(s,l,h);        # 14 t7:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    t8 := algebra.select(s,l,h);        # 15 t8:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
-    z := mat.pack(t1,t2,t3,t4,t5,t6,t7,t8);# 16 z:bat[:oid,:dbl] := 
MATpack(t1:bat[:oid,:dbl], t2:bat[:oid,:dbl], t3:bat[:oid,:dbl], 
t4:bat[:oid,:dbl], t5:bat[:oid,:dbl], t6:bat[:oid,:dbl], t7:bat[:oid,:dbl], 
t8:bat[:oid,:dbl]) {G}
+    t1 := algebra.select(s,l,h);        #  8 t1:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t2 := algebra.select(s,l,h);        #  9 t2:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t3 := algebra.select(s,l,h);        # 10 t3:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t4 := algebra.select(s,l,h);        # 11 t4:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t5 := algebra.select(s,l,h);        # 12 t5:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t6 := algebra.select(s,l,h);        # 13 t6:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t7 := algebra.select(s,l,h);        # 14 t7:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    t8 := algebra.select(s,l,h);        # 15 t8:bat[:oid,:int] := 
ALGselect(s:bat[:oid,:int], l:int, h:int) {G}
+    z := mat.pack(t1,t2,t3,t4,t5,t6,t7,t8);# 16 z:bat[:oid,:int] := 
MATpack(t1:bat[:oid,:int], t2:bat[:oid,:int], t3:bat[:oid,:int], 
t4:bat[:oid,:int], t5:bat[:oid,:int], t6:bat[:oid,:int], t7:bat[:oid,:int], 
t8:bat[:oid,:int]) {G}
 exit go;                                # 17 go:int 
-    s := nil:BAT;                       # 18 s:bat[:oid,:dbl] := _23:BAT {G}
-    mdb.var();                          # 19 _17:void := MDBvar() 
-    c := aggr.count(z);                 # 20 c:wrd := 
ALGcount_bat(z:bat[:oid,:dbl]) {G}
-    io.print(c);                        # 21 _19:void := IOprint_val(c:wrd) 
-    io.print("done");                   # 22 _20:void := IOprint_val(_21:str) 
{G}
+    s := nil:BAT;                       # 18 s:bat[:oid,:int] := _25:BAT {G}
+    mdb.var();                          # 19 _19:void := MDBvar() 
+    c := aggr.count(z);                 # 20 c:wrd := 
ALGcount_bat(z:bat[:oid,:int]) {G}
+    io.print(c);                        # 21 _21:void := IOprint_val(c:wrd) 
+    io.print("done");                   # 22 _22:void := IOprint_val(_23:str) 
{G}
 end tst;                                # 23  
 
 
diff --git a/monetdb5/optimizer/Tests/dataflow.timeout 
b/monetdb5/optimizer/Tests/dataflow.timeout
deleted file mode 100644
--- a/monetdb5/optimizer/Tests/dataflow.timeout
+++ /dev/null
@@ -1,1 +0,0 @@
-2
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -443,6 +443,7 @@ SQLinitClient(Client c)
                                p = strchr(filename, PATH_SEP);
                                if (p)
                                        *p = '\0';
+                               fprintf(stdout, "# SQL loading sql scripts 
%s\n",filename);
                                fd = open_rastream(filename);
                                if (p)
                                        filename = p + 1;
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -4718,10 +4718,11 @@ reduce_scale(atom *a)
                lng v = a->data.val.lval;
                int i = 0;
 
-               while( (v/10)*10 == v ) {
-                       i++;
-                       v /= 10;
-               }
+               if (v != 0) 
+                        while( (v/10)*10 == v ) {
+                                i++;
+                                v /= 10;
+                        }
                a->data.val.lval = v;
                return i;
        }
@@ -4729,22 +4730,24 @@ reduce_scale(atom *a)
                int v = a->data.val.ival;
                int i = 0;
 
-               while( (v/10)*10 == v ) {
-                       i++;
-                       v /= 10;
-               }
-               a->data.val.lval = v;
+               if (v != 0) 
+                        while( (v/10)*10 == v ) {
+                                i++;
+                                v /= 10;
+                        }
+               a->data.val.ival = v;
                return i;
        }
        if (a->data.vtype == TYPE_sht) {
                sht v = a->data.val.shval;
                int i = 0;
 
-               while( (v/10)*10 == v ) {
-                       i++;
-                       v /= 10;
-               }
-               a->data.val.lval = v;
+               if (v != 0) 
+                        while( (v/10)*10 == v ) {
+                                i++;
+                                v /= 10;
+                        }
+               a->data.val.shval = v;
                return i;
        }
        return 0;
diff --git a/sql/sql/15_history.sql b/sql/sql/15_history.sql
--- a/sql/sql/15_history.sql
+++ b/sql/sql/15_history.sql
@@ -23,6 +23,13 @@
 -- Whenever a query is compiled and added to the cache, it is also entered
 -- into the 'queryHistory' table using a hardwired call to 'keepQuery'.
 
+-- Temporary and locally disable mitosis to prevent yet undiscoved deadlock;
+-- cf., bug 2865 (http://bugs.monetdb.org/show_bug.cgi?id=2865)
+declare dft_opt string;
+set dft_opt = ( select optimizer );
+set optimizer = 'no_mitosis_pipe';
+-- cf., `set optimizer = dft_opt` at the end of this script
+
 create table queryHistory(
        id wrd primary key,
        defined timestamp,      -- when entered into the cache
@@ -110,4 +117,7 @@ begin
        delete from queryHistory;
 end;
 
+-- cf., top of this script
+set optimizer = dft_opt;
+
 -- set history=true;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to