Changeset: 6c21cfa87a7f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6c21cfa87a7f
Modified Files:
        sql/backends/monet5/bin_partition_by_slice.c
Branch: default
Log Message:

Fix lng/dbl multiplication: put cast in correct spot.


diffs (21 lines):

diff --git a/sql/backends/monet5/bin_partition_by_slice.c 
b/sql/backends/monet5/bin_partition_by_slice.c
--- a/sql/backends/monet5/bin_partition_by_slice.c
+++ b/sql/backends/monet5/bin_partition_by_slice.c
@@ -354,7 +354,7 @@ rel_groupby_prepare_pp(list **aggrresult
                        sql_subtype *t = exp_subtype(e);
                        /* ext */
                        lng ncard = exp_getcard(be->mvc, rel, e);
-                       card *= ncard * corr_weight;
+                       card = (lng) (card * ncard * corr_weight);
                        corr_weight *= 0.85;
                        if (card > estimate || ncard >= estimate)
                                card = estimate;
@@ -856,7 +856,7 @@ rel_groupby_partition(mvc *sql, sql_rel 
                for( node *n = l->h; n; n = n->next ) {
                        sql_exp *e = n->data;
                        lng ncard = exp_getcard(sql, rel, e);
-                       card *= ncard * corr_weight; /* TODO check for overflow 
*/
+                       card = (lng) (card * ncard * corr_weight); /* TODO 
check for overflow */
                        corr_weight *= 0.85;
                        if (card > estimate || ncard >= estimate) {
                                card = estimate;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to