Changeset: e2894017aa37 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2894017aa37
Modified Files:
        sql/backends/monet5/generator/generator.c
Branch: generator
Log Message:

Fix boundary checks and equality.


diffs (33 lines):

diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -447,16 +447,10 @@ VLTgenerator_subselect(Client cntxt, Mal
                        tlow = *(timestamp*) getArgReference(stk,pci,i);
                        thgh = *(timestamp*) getArgReference(stk,pci,i+1);
 
-                       if( hi && !timestamp_isnil(thgh) ){
-                               msg = MTIMEtimestamp_add(&thgh, &thgh, &tss);
-                               if (msg != MAL_SUCCEED) 
-                                       return msg;
-                       }
-                       if( !li && !timestamp_isnil(tlow) ){
-                               msg = MTIMEtimestamp_add(&tlow, &tlow, &tss);
-                               if (msg != MAL_SUCCEED) 
-                                       return msg;
-                       }
+                       if( hi && !timestamp_isnil(thgh) )
+                               thgh.msecs++;
+                       if( !li && !timestamp_isnil(tlow) )
+                               tlow.msecs++;
 
                        /* casting one value to lng causes the whole
                         * computation to be done as lng, reducing the
@@ -740,7 +734,7 @@ str VLTgenerator_thetasubselect(Client c
                        val = f;
                        for(j = 0; j< cap; j++,  o++){
                                if( (( timestamp_isnil(low) || (val.days > 
low.days || (val.days == low.days && val.msecs >=low.msecs))) && 
-                                        ( timestamp_isnil(hgh) || (val.days < 
hgh.days || (val.days == hgh.days && val.msecs <= hgh.msecs)))) || anti){
+                                        ( timestamp_isnil(hgh) || (val.days < 
hgh.days || (val.days == hgh.days && val.msecs < hgh.msecs)))) || anti){
                                        if(cand){
                                                if( cl){ while(cn-- >= 0 && *cl 
< o) cl++; if ( *cl == o){ *v++= o; c++;}}
                                                else { while(cn-- >= 0 && oc < 
o) oc++; if ( oc == o){ *v++= o; c++;} }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to