Update of /cvsroot/monetdb/sql/src/server
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4076/src/server

Modified Files:
        sql_select.mx 
Log Message:
propagated changes of Thursday Jul 10 2008 - Monday Jul 14 2008
from the SQL_2-24 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/07/10 - nielsnes: src/server/sql_select.mx,1.231.2.8
fixed support for IS NULL in selection
fixed bug in groupby and selection with constants (old bin alg only)
fixed bug in range join rewrites
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: sql_select.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_select.mx,v
retrieving revision 1.237
retrieving revision 1.238
diff -u -d -r1.237 -r1.238
--- sql_select.mx       20 Jun 2008 20:50:31 -0000      1.237
+++ sql_select.mx       14 Jul 2008 07:57:37 -0000      1.238
@@ -3520,14 +3520,13 @@
                }
        }
                break;
-       case SQL_NULL:
-       case SQL_NOT_NULL:
+       case SQL_IS_NULL:
+       case SQL_IS_NOT_NULL:
        /* is (NOT) NULL */
        {
                symbol *cr = sc->data.sym;
                stmt *res = sql_value_exp(sql, scp, cr, grp, subset, f, iek);
 
-               /* TODO predicate! */
                if (res && (res->nrcols == 0 || f == sql_sel)) {
                        sql_subtype *bt = sql_bind_localtype("bit");
                        sql_subtype *tp = tail_type(res);
@@ -3538,7 +3537,7 @@
                                return NULL;
                        }
                        res = stmt_unop(res, isnul);
-                       if (sc->token != SQL_NULL) {
+                       if (sc->token != SQL_IS_NULL) {
                                sql_subfunc *not = 
sql_bind_func_result(sql->session->schema, "not", bt, NULL, bt);
                                res = stmt_unop(res, not);
                        } 
@@ -3546,7 +3545,7 @@
                        sql_subtype *tpe = tail_type(res);
                        stmt *a = stmt_atom(atom_general(tpe, NULL, 0));
 
-                       if (sc->token == SQL_NULL) {
+                       if (sc->token == SQL_IS_NULL) {
                                res = stmt_uselect(res, a, cmp_equal);
                        } else {
                                res = stmt_uselect(res, a, cmp_notequal);
@@ -4050,7 +4049,9 @@
                                        return sql_error(sql, 02, "SELECT: 
single value in column expression");
                                        /* properly handle select '' from x */
                                } else if (!cs->aggr && !aggr) {
-                                       stmt *ss = first_subset(subset);
+                                       stmt *ss = (grp)?
+                                               stmt_dup(grp->ext):
+                                               first_subset(subset);
 
                                        cs = stmt_const(ss, stmt_dup(cs));
                                        list_append(rl, cs);


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to