Changeset: 8b0a5fc397e4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b0a5fc397e4
Modified Files:
        
Branch: Jun2010
Log Message:

Merge.


diffs (172 lines):

diff -r c14958692d3b -r 8b0a5fc397e4 MonetDB5/src/modules/kernel/calc.mx
--- a/MonetDB5/src/modules/kernel/calc.mx       Tue Jul 06 17:11:00 2010 +0200
+++ b/MonetDB5/src/modules/kernel/calc.mx       Tue Jul 06 17:17:16 2010 +0200
@@ -312,6 +312,7 @@
                address calcbinarymin_no_...@2;
 @-
 @mal
+       @:mal_binary_ops(bit,bit)@
        @:mal_binary_ops(chr,chr)@
        @:mal_binary_ops(bte,bte)@
        @:mal_binary_ops(sht,sht)@
@@ -339,6 +340,7 @@
                address calcun...@1sign 
                comment "Returns +1, 0, -1 based on the sign of the given 
expression";
 @= unary_ops
+       @:@1_unary_ops(bit)@
        @:@1_unary_ops(chr)@
        @:@1_unary_ops(bte)@
        @:@1_unary_ops(sht)@
@@ -667,6 +669,7 @@
 @:calc_macrobinop_no_nil(MIN,calc_min_no_n...@1,@1)@
 @c
 
+@:calc_min_max(bit)@
 @:calc_min_max(chr)@
 @:calc_min_max(bte)@
 @:calc_min_max(sht)@
diff -r c14958692d3b -r 8b0a5fc397e4 
MonetDB5/src/modules/mal/Tests/inspect05.stable.out
--- a/MonetDB5/src/modules/mal/Tests/inspect05.stable.out       Tue Jul 06 
17:11:00 2010 +0200
+++ b/MonetDB5/src/modules/mal/Tests/inspect05.stable.out       Tue Jul 06 
17:17:16 2010 +0200
@@ -4346,6 +4346,7 @@
 [ "-",                           "command",      "calc",         "(x:sht):sht 
",                                                                              
                                           "CALCunaryshtNEG;"                   
                   ]
 [ "-",                           "command",      "calc",         "(x:bte):bte 
",                                                                              
                                           "CALCunarybteNEG;"                   
                   ]
 [ "-",                           "command",      "calc",         "(x:chr):chr 
",                                                                              
                                           "CALCunarychrNEG;"                   
                   ]
+[ "-",                           "command",      "calc",         "(x:bit):bit 
",                                                                              
                                   "CALCunarybitNEG;"                           
           ]
 [ "-",                           "command",      "calc",         
"(left:lng,right:dbl):dbl ",                                                    
                                                        "CALCbinarySUBlngdbl;"  
                                ]
 [ "-",                           "command",      "calc",         
"(left:lng,right:flt):dbl ",                                                    
                                                        "CALCbinarySUBlngflt;"  
                                ]
 [ "-",                           "command",      "calc",         
"(left:lng,right:lng):lng ",                                                    
                                                        "CALCbinarySUBlnglng;"  
                                ]
@@ -4726,6 +4727,7 @@
 [ "abs",                         "command",      "calc",         "(x:sht):sht 
",                                                                              
                                           "CALCunaryshtABS;"                   
                   ]
 [ "abs",                         "command",      "calc",         "(x:bte):bte 
",                                                                              
                                           "CALCunarybteABS;"                   
                   ]
 [ "abs",                         "command",      "calc",         "(x:chr):chr 
",                                                                              
                                           "CALCunarychrABS;"                   
                   ]
+[ "abs",                         "command",      "calc",         "(x:bit):bit 
",                                                                              
                                   "CALCunarybitABS;"                           
           ]
 [ "blob",                        "command",      "calc",         "(s:str):blob 
",                                                                              
                                          "BLOBblob_fromstr;"                   
                  ]
 [ "blob",                        "command",      "calc",         
"(b:blob):blob ",                                                               
                                                        "BLOBblob_blob;"        
                                ]
 [ "bat",                         "command",      "calc",         
"(v:void):bat[:any_1,:any_2] ",                                                 
                                                        "CALCnil2bat;"          
                                ]
@@ -4872,6 +4874,7 @@
 [ "inv",                         "command",      "calc",         "(x:sht):sht 
",                                                                              
                                           "CALCunarycheckshtINV;"              
                   ]
 [ "inv",                         "command",      "calc",         "(x:bte):bte 
",                                                                              
                                           "CALCunarycheckbteINV;"              
                   ]
 [ "inv",                         "command",      "calc",         "(x:chr):chr 
",                                                                              
                                           "CALCunarycheckchrINV;"              
                   ]
+[ "inv",                         "command",      "calc",         "(x:bit):bit 
",                                                                              
                                   "CALCunarycheckbitINV;"                      
           ]
 [ "isnotnil",                    "command",      "calc",         "(v:void):bit 
",                                                                              
                                          "CALCisnotnil_void;"                  
                  ]
 [ "isnil",                       "command",      "calc",         "(v:void):bit 
",                                                                              
                                          "CALCisnil_void;"                     
                  ]
 [ "isnotnil",                    "command",      "calc",         "(v:BAT):bit 
",                                                                              
                                           "CALCisnotnil_bat;"                  
                   ]
@@ -4963,6 +4966,10 @@
 [ "max_no_nil",                          "command",      "calc",         
"(l:chr,r:chr):chr ",                                                           
                                                        
"CALCbinaryMAX_NO_NILchr;"                              ]
 [ "min",                         "command",      "calc",         
"(l:chr,r:chr):chr ",                                                           
                                                        "CALCbinaryMINchr;"     
                                ]
 [ "max",                         "command",      "calc",         
"(l:chr,r:chr):chr ",                                                           
                                                        "CALCbinaryMAXchr;"     
                                ]
+[ "min_no_nil",                          "command",      "calc",         
"(ll:bit,r:bit):bit ",                                                          
                                                "CALCbinaryMIN_NO_NILbit;"      
                        ]
+[ "max_no_nil",                          "command",      "calc",         
"(l:bit,r:bit):bit ",                                                           
                                                "CALCbinaryMAX_NO_NILbit;"      
                        ]
+[ "min",                         "command",      "calc",         
"(l:bit,r:bit):bit ",                                                           
                                                "CALCbinaryMINbit;"             
                        ]
+[ "max",                         "command",      "calc",         
"(l:bit,r:bit):bit ",                                                           
                                                "CALCbinaryMAXbit;"             
                        ]
 [ "newoid",                      "command",      "calc",         
"(incr:int):oid ",                                                              
                                                        "CALCnewoidInc;"        
                                ]
 [ "newoid",                      "command",      "calc",         
"(incr:lng):oid ",                                                              
                                                        "CALCnewoidInclng;"     
                                ]
 [ "newoid",                      "command",      "calc",         "():oid ",    
                                                                                
                                          "CALCnewoidBase;"                     
                  ]
@@ -5046,6 +5053,8 @@
 [ "sizeof",                      "command",      "calc",         "(x:bte):int 
",                                                                              
                                           "CALCsizeofbte;"                     
                   ]
 [ "sign",                        "command",      "calc",         "(x:chr):chr 
",                                                                              
                                           "CALCunarychrSIGN;"                  
                   ]
 [ "sizeof",                      "command",      "calc",         "(x:chr):int 
",                                                                              
                                           "CALCsizeofchr;"                     
                   ]
+[ "sign",                        "command",      "calc",         "(x:bit):bit 
",                                                                              
                                   "CALCunarybitSIGN;"                          
           ]
+[ "sizeof",                      "command",      "calc",         "(x:bit):int 
",                                                                              
                                   "CALCsizeofbit;"                             
           ]
 [ "sqladd",                              "command",      "calc",         
"(left:lng,right:dbl):dbl ",                                                    
                                                        
"CALCbinarySQLADDlngdbl;"                               ]
 [ "sqladd",                              "command",      "calc",         
"(left:lng,right:flt):dbl ",                                                    
                                                        
"CALCbinarySQLADDlngflt;"                               ]
 [ "sqladd",                              "command",      "calc",         
"(left:lng,right:lng):lng ",                                                    
                                                        
"CALCbinarySQLADDlnglng;"                               ]
diff -r c14958692d3b -r 8b0a5fc397e4 
pathfinder/compiler/algebra/opt/opt_complex.c
--- a/pathfinder/compiler/algebra/opt/opt_complex.c     Tue Jul 06 17:11:00 
2010 +0200
+++ b/pathfinder/compiler/algebra/opt/opt_complex.c     Tue Jul 06 17:17:16 
2010 +0200
@@ -2147,20 +2147,21 @@
                 for (unsigned int i = 0; i < schema.count; i++)
                     schema.items[i].name =
                         PFord_order_col_at (p->sem.sort.sortby, i);
-                 if (PFprop_ckey (p->prop, schema)) {
-                     *p = *PFla_rowrank (
-                               L(p),
-                               p->sem.sort.res,
-                               p->sem.sort.sortby);
-                    modified = true;
-                    break;
-                 }
+                if (PFprop_ckey (p->prop, schema)) {
+                    *p = *PFla_rowrank (
+                              L(p),
+                              p->sem.sort.res,
+                              p->sem.sort.sortby);
+                   modified = true;
+                   break;
+                }
             }
 
             /* Replace the rownumber operator by a projection
                if only its value distribution (keys) are required
                instead of its real values. */
             if (!PFprop_req_value_col (p->prop, p->sem.sort.res) &&
+               !p->sem.sort.part &&
                 PFord_count (p->sem.sort.sortby) == 1 &&
                 PFprop_key (p->prop,
                             PFord_order_col_at (p->sem.sort.sortby, 0))) {
diff -r c14958692d3b -r 8b0a5fc397e4 pathfinder/compiler/algebra/prop/prop_dom.c
--- a/pathfinder/compiler/algebra/prop/prop_dom.c       Tue Jul 06 17:11:00 
2010 +0200
+++ b/pathfinder/compiler/algebra/prop/prop_dom.c       Tue Jul 06 17:17:16 
2010 +0200
@@ -907,9 +907,11 @@
                                         L(n)->schema.items[i].name),
                             dom);
 
-                add_disjdom (dom,
-                             PFprop_dom (R(n)->prop,
-                                         L(n)->schema.items[i].name));
+                /* we can only infer the disjointness for a single column */
+                if (n->schema.count == 1)
+                    add_disjdom (dom,
+                                 PFprop_dom (R(n)->prop,
+                                             L(n)->schema.items[i].name));
             }
             break;
 
diff -r c14958692d3b -r 8b0a5fc397e4 
pathfinder/compiler/algebra/prop/prop_name_origin.c
--- a/pathfinder/compiler/algebra/prop/prop_name_origin.c       Tue Jul 06 
17:11:00 2010 +0200
+++ b/pathfinder/compiler/algebra/prop/prop_name_origin.c       Tue Jul 06 
17:17:16 2010 +0200
@@ -227,7 +227,7 @@
                 if (n->sem.aggr.aggr[i].kind == alg_aggr_dist &&
                     PFprop_name_origin (L(n)->prop, n->sem.aggr.aggr[i].col))
                     add_name (n->prop,
-                              n->sem.aggr.aggr[i].col,
+                              n->sem.aggr.aggr[i].res,
                               PFprop_name_origin (L(n)->prop, 
                                                   n->sem.aggr.aggr[i].col));
 
diff -r c14958692d3b -r 8b0a5fc397e4 pathfinder/compiler/sql/lalg2sql.brg
--- a/pathfinder/compiler/sql/lalg2sql.brg      Tue Jul 06 17:11:00 2010 +0200
+++ b/pathfinder/compiler/sql/lalg2sql.brg      Tue Jul 06 17:17:16 2010 +0200
@@ -4136,7 +4136,7 @@
                         }
                         /* In case the column did not exist in
                            the column list already ... */
-                        if (!found)
+                        if (!found && !IS_LITERAL(expr))
                             /* ... extend the group by list. */
                             groupbylist = column_list (groupbylist, expr);
                     }   break;
diff -r c14958692d3b -r 8b0a5fc397e4 sql/src/server/sql_rel2bin.mx
--- a/sql/src/server/sql_rel2bin.mx     Tue Jul 06 17:11:00 2010 +0200
+++ b/sql/src/server/sql_rel2bin.mx     Tue Jul 06 17:17:16 2010 +0200
@@ -416,6 +416,10 @@
        for (bc = basecols->h; bc; bc = bc->next) {
                list *colsels = list_select(haveBasecol, bc->data, (fcmp) 
&cmp_sel_basecol, (fdup) &stmt_dup);
                sql_subtype *tt = tail_type(((stmt *) 
(colsels->h->data))->op2.stval);
+               sql_subtype *tt2 = tt;
+
+               if (list_length(colsels) > 1)
+                       tt2 = tail_type(((stmt *) 
(colsels->h->next->data))->op2.stval);
 
                assert(tt);
                if (list_length(colsels) == 1) {
@@ -426,7 +430,7 @@
                                list_prepend(newsels, s);
                        else
                                list_append(newsels, s);
-               } else if (tt->type->localtype == TYPE_str || !(min = 
sql_bind_func_result(sql->session->schema, "sql_min", tt, tt, tt)) || !(max = 
sql_bind_func_result(sql->session->schema, "sql_max", tt, tt, tt))) {
+               } else if (tt2 != tt ||  tt->type->localtype == TYPE_str || 
!(min = sql_bind_func_result(sql->session->schema, "sql_min", tt, tt, tt)) || 
!(max = sql_bind_func_result(sql->session->schema, "sql_max", tt, tt, tt))) {
                        /* no "min" and/or "max" available on this data type, 
hence, we cannot apply the following "tricks" */
                        list_merge(newsels, colsels, (fdup) &stmt_dup);
                } else {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to