Changeset: 0fecb956c0c0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0fecb956c0c0
Modified Files:
sql/server/rel_unnest.c
Branch: interval-day-second
Log Message:
No longer rel_optimize EC_SEC -> EC_SEC conversions
Now that we pay more attention to ->digits the result is no longer equivalent.
Also, it doesn't generate any MAL code anymore in these situations so there is
no hard reason to optimize it away.
Example where this makes a difference:
SELECT sql_sub(CAST(INTERVAL '3' SECOND AS INTERVAL DAY), INTERVAL '2' DAY)
FROM "rt3"
(but curiously only when "rt3" is a REMOTE TABLE.)
diffs (22 lines):
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -2103,17 +2103,7 @@ exp_physical_types(visitor *v, sql_rel *
if (!e || (e->type != e_func && e->type != e_convert) || !e->l)
return e;
- if (e->type == e_convert) {
- sql_subtype *ft = exp_fromtype(e);
- sql_subtype *tt = exp_totype(e);
-
- /* complex conversion matrix */
- if (ft->type->eclass == EC_SEC && tt->type->eclass == EC_SEC &&
ft->type->digits > tt->type->digits) {
- /* no conversion needed, just time adjustment */
- ne = e->l;
- ne->tpe = *tt; // ugh
- }
- } else {
+ if (e->type != e_convert) {
list *args = e->l;
sql_subfunc *f = e->f;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]