Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1230/src/server
Modified Files:
Tag: Feb2009
rel_select.mx
Log Message:
fix the in operator in the selection phase
fix naming of group by expressions
U rel_select.mx
Index: rel_select.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/rel_select.mx,v
retrieving revision 1.113.2.2
retrieving revision 1.113.2.3
diff -u -d -r1.113.2.2 -r1.113.2.3
--- rel_select.mx 2 Feb 2009 20:58:00 -0000 1.113.2.2
+++ rel_select.mx 5 Feb 2009 21:50:18 -0000 1.113.2.3
@@ -637,7 +637,7 @@
static sql_exp *rel_groupby_add_aggr(mvc *sql, sql_rel *rel, sql_exp *e)
{
- sql_exp *m = NULL;
+ sql_exp *m = NULL, *ne;
char name[16], *nme = NULL;
char *tname = NULL;
@@ -651,7 +651,9 @@
}
if (e->type == e_column)
tname = e->l;
- return exp_column(tname, m->name, exp_subtype(m), rel->card,
has_nil(m), is_intern(m));
+ ne = exp_column(tname, m->name, exp_subtype(m), rel->card, has_nil(m),
is_intern(m));
+ exp_setname(ne, NULL, e->name);
+ return ne;
}
void
@@ -1989,7 +1991,12 @@
ek.card = card_set;
- /* we assume the selection case */
+ /* only selection phase ! */
+ if (f < sql_sel)
+ assert(0);
+
+ if (!left)
+ left = *rel;
if (f >= sql_sel) {
if (left && is_project(left->op)) {
p = left;
@@ -2004,12 +2011,7 @@
left = rel_project_exp(l);
else
left = rel_dup(left);
- if (!p)
- p = *rel;
- l = exp_alias_or_copy(sql, NULL, NULL, left, l, 0);
- /* list of values or subqueries */
- /* single element could be a 'select' */
if (n->type == type_list) {
sql_subtype *st = exp_subtype(l);
@@ -2052,14 +2054,18 @@
r = rel_lastexp(sql, right);
rel_setsubquery(right);
- if (p)
- rel_destroy(p->l);
if (rel_convert_types(sql, &l, &r, 1, type_equal) < 0) {
exp_destroy(l);
exp_destroy(r);
return NULL;
}
- left = p->l = rel_crossproduct(left, right, op_join);
+ left = rel_crossproduct(left, right, op_join);
+ if (p) {
+ rel_destroy(p->l);
+ p->l = left;
+ }
+ if (!p)
+ *rel = left;
left->op = op_left;
e = exp_compare( l, r, cmp_equal );
rel_join_add_exp(left, e);
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins