Changeset: 4f3333de1d42 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f3333de1d42
Modified Files:
        sql/server/rel_statistics.c
Branch: properties
Log Message:

For now propagate min/max at conversions between number classes only, so the 
order is kept


diffs (34 lines):

diff --git a/sql/server/rel_statistics.c b/sql/server/rel_statistics.c
--- a/sql/server/rel_statistics.c
+++ b/sql/server/rel_statistics.c
@@ -324,18 +324,20 @@ rel_propagate_statistics(visitor *v, sql
                }
        } break;
        case e_convert: {
-               sql_subtype *to = exp_totype(e);
+               sql_subtype *to = exp_totype(e), *from = exp_fromtype(e);
                sql_exp *l = e->l;
 
-               if ((lval = find_prop_and_get(l->p, PROP_MAX))) {
-                       atom *res = atom_dup(sql->sa, lval);
-                       if (atom_cast(sql->sa, res, to))
-                               set_property(sql, e, PROP_MAX, res);
-               }
-               if ((lval = find_prop_and_get(l->p, PROP_MIN))) {
-                       atom *res = atom_dup(sql->sa, lval);
-                       if (atom_cast(sql->sa, res, to))
-                               set_property(sql, e, PROP_MIN, res);
+               if (EC_NUMBER(from->type->eclass) && 
EC_NUMBER(to->type->eclass)) {
+                       if ((lval = find_prop_and_get(l->p, PROP_MAX))) {
+                               atom *res = atom_dup(sql->sa, lval);
+                               if (atom_cast(sql->sa, res, to))
+                                       set_property(sql, e, PROP_MAX, res);
+                       }
+                       if ((lval = find_prop_and_get(l->p, PROP_MIN))) {
+                               atom *res = atom_dup(sql->sa, lval);
+                               if (atom_cast(sql->sa, res, to))
+                                       set_property(sql, e, PROP_MIN, res);
+                       }
                }
                if (!has_nil(l))
                        set_has_no_nil(e);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to