MonetDB: Oct2012 - fixed bug 3209, ie first crossproduct if the ...

Ying Zhang Y.Zhang at cwi.nl
Sun Dec 16 20:08:01 CET 2012


Hai Niels,

Your fix works in Feb2013, but not in Oct2012…

Jennie

On Dec 15, 2012, at 12:29, Niels Nes wrote:

> Changeset: 8650dce52dd8 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8650dce52dd8
> Modified Files:
> 	sql/server/rel_exp.c
> 	sql/server/rel_exp.h
> Branch: Oct2012
> Log Message:
> 
> fixed bug 3209, ie first crossproduct if the join expression consists
> of functions (these should have been pushed down, whenever possible).
> 
> 
> diffs (59 lines):
> 
> diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
> --- a/sql/server/rel_exp.c
> +++ b/sql/server/rel_exp.c
> @@ -1032,6 +1032,44 @@ exp_is_atom( sql_exp *e )
> }
> 
> static int
> +exps_has_func( list *exps)
> +{
> +	node *n;
> +	int has_func = 0;
> +
> +	for(n=exps->h; n && !has_func; n=n->next) 
> +		has_func |= exp_has_func(n->data);
> +	return has_func;
> +}
> +
> +int
> +exp_has_func( sql_exp *e )
> +{
> +	switch (e->type) {
> +	case e_atom:
> +		return 0;
> +	case e_convert:
> +		return exp_has_func(e->l);
> +	case e_func:
> +	case e_aggr:
> +		return 1;
> +	case e_cmp:
> +		if (e->flag == cmp_or) {
> +			return (exps_has_func(e->l) || exps_has_func(e->r));
> +		} else if (e->flag == cmp_in || e->flag == cmp_notin || e->flag == cmp_filter) {
> +			return (exp_has_func(e->l) || exps_has_func(e->r));
> +		} else {
> +			return (exp_has_func(e->l) || exp_has_func(e->r) || 
> +					(e->f && exp_has_func(e->f)));
> +		}
> +	case e_column:
> +	case e_psm:
> +		return 0;
> +	}
> +	return 0;
> +}
> +
> +static int
> exp_key( sql_exp *e )
> {
> 	if (e->name)
> diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h
> --- a/sql/server/rel_exp.h
> +++ b/sql/server/rel_exp.h
> @@ -105,6 +105,7 @@ extern int exp_is_eqjoin(sql_exp *e);
> extern int exp_is_correlation(sql_exp *e, sql_rel *r );
> extern int exp_is_join_exp(sql_exp *e);
> extern int exp_is_atom(sql_exp *e);
> +extern int exp_has_func(sql_exp *e);
> 
> extern sql_exp *exps_bind_column( list *exps, char *cname, int *ambiguous);
> extern sql_exp *exps_bind_column2( list *exps, char *rname, char *cname);
> _______________________________________________
> checkin-list mailing list
> checkin-list at monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list

_______________________________________________
developers-list mailing list
developers-list at monetdb.org
http://mail.monetdb.org/mailman/listinfo/developers-list



More information about the developers-list mailing list