Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20113/src/backends/monet5

Modified Files:
        sql_optimizer.mx 
Log Message:
fixes to SQLgetStatistics, now correctly pass nil instead of -1, for unknown
lower/upper bounds


U sql_optimizer.mx
Index: sql_optimizer.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_optimizer.mx,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- sql_optimizer.mx    25 Mar 2008 14:27:05 -0000      1.179
+++ sql_optimizer.mx    24 Apr 2008 20:39:18 -0000      1.180
@@ -339,14 +339,14 @@
 
                                if (active_store_type == store_bpm) {
                                        bpm = i->data;
-                                       if (mode == RDONLY /* currently all 
updates are kept together || mode == RD_UPD */)
+                                       if (mode == RDONLY || mode == RD_UPD)
                                                part = bpm->ins;
                                        else if (mode == RD_INS) {
                                                part = bpm->nr - bpm->ins;
                                                off = bpm->ins;
                                        }
                                }
-                               if (i->t->cnt && mode == RDONLY)
+                               if (i->t->cnt && (mode == RDONLY || mode == 
RD_UPD))
                                        rows = i->t->cnt;
                        } else if ( f == bindRef) {
                                sql_schema *s = mvc_bind_schema(m, sname);
@@ -357,14 +357,14 @@
 
                                if (active_store_type == store_bpm) {
                                        bpm = c->data;
-                                       if (mode == RDONLY /* currently all 
updates are kept together || mode == RD_UPD */)
+                                       if (mode == RDONLY || mode == RD_UPD)
                                                part = bpm->ins;
                                        else if (mode == RD_INS) {
                                                part = bpm->nr - bpm->ins;
                                                off = bpm->ins;
                                        }
                                }
-                               if (c->t->cnt && mode == RDONLY)
+                               if (c->t->cnt && (mode == RDONLY || mode == 
RD_UPD))
                                        rows = c->t->cnt;
                        }       
                        varSetProp(mb, k, rowsProp, op_eq, VALset(&vr, 
TYPE_lng, &rows));
@@ -383,12 +383,14 @@
                        }
                        if (part <= 1) {
                                pushInstruction(mb,p);
-                               if (bpm && mode != RD_UPD) {
+                               if (bpm) {
                                        oid low = 0, high = 1;
 
                                        low = bpm->parts[off].hlow;
+                                       assert(low != (oid)-1);
                                        high = bpm->parts[off].hhgh;
-
+                                       if (high == (oid)-1)
+                                               high = oid_nil;
                                        varSetProp(mb, getArg(p,0), hlbProp, 
op_gte, VALset(&vr, TYPE_oid, &low));
                                        varSetProp(mb, getArg(p,0), hubProp, 
op_lt, VALset(&vr, TYPE_oid, &high));
                                }
@@ -403,6 +405,8 @@
                                        low = bpm->parts[off+i].hlow;
                                        assert(low != (oid)-1);
                                        high = bpm->parts[off+i].hhgh;
+                                       if (high == (oid)-1)
+                                               high = oid_nil;
                                        q = newInstruction(mb, ASSIGNsymbol);
                                        setModuleId(q, matRef);
                                        setFunctionId(q, f);


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to