Update of /cvsroot/monetdb/sql/src/server
In directory sc8-pr-cvs16:/tmp/cvs-serv16887/src/server

Modified Files:
        rel_semantic.mx sql_optimize.mx 
Log Message:
fixed range_predicate bug. Need to keep joins on the same tables equaly 
oriented, else we push selects through the wrong side of the join.


Index: sql_optimize.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_optimize.mx,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- sql_optimize.mx     26 Apr 2007 14:35:08 -0000      1.78
+++ sql_optimize.mx     12 May 2007 22:24:10 -0000      1.79
@@ -35,6 +35,7 @@
 #include "sql_optimize.h"
 #include "sql_env.h"
 #include <stdio.h>
+#include "rel_semantic.h"
 
 #define create_stmt_list() list_create((fdestroy)&stmt_destroy)
 
@@ -786,10 +787,10 @@
                        assert(j->op2.stval->type==st_reverse);
                        if (!STMT_BAT(j->op2.stval->op1.stval->type))
                                continue;
-                       if (j->t == join->h && j->type == st_join && j->flag == 
cmp_equal ) {
+                       if (j->t == join->h && j->type == st_join) {
                                stmt *jh = stmt_dup(j->op2.stval->op1.stval);
                                stmt *jt = stmt_reverse(stmt_dup(j->op1.stval));
-                               jn->data = stmt_join(jh, jt, 
(comp_type)j->flag);
+                               jn->data = stmt_join(jh, jt, 
swap_compare((comp_type)j->flag));
                                stmt_destroy(j);
                        } else if (j->t == join->h && j->type == st_reljoin) {
                                list *l1 = list_dup(j->op1.lval, 
(fdup)&stmt_dup);

Index: rel_semantic.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/rel_semantic.mx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- rel_semantic.mx     3 May 2007 23:36:49 -0000       1.21
+++ rel_semantic.mx     12 May 2007 22:24:10 -0000      1.22
@@ -31,7 +31,6 @@
 extern sql_rel *rel_semantic(mvc *sql, symbol *sym);
 extern sql_rel *rel_parse(mvc *m, char *query);
 
-/* TODO: move to general code base (include/common) later */
 extern comp_type swap_compare( comp_type t );
 
 #endif /*_REL_SEMANTIC_H_*/


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to