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

Add some error checking.


diffs (40 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
@@ -365,10 +365,12 @@ VLTgenerator_subselect(Client cntxt, Mal
                            tlow.days == thgh.days &&
                            !timestamp_isnil(tlow))
                                hi = li;
-                       if( hi && !timestamp_isnil(thgh) )
-                               MTIMEtimestamp_add(&thgh, &thgh, &one);
-                       if( !li && !timestamp_isnil(tlow) )
-                               MTIMEtimestamp_add(&tlow, &tlow, &one);
+                       if( hi && !timestamp_isnil(thgh) &&
+                           (msg = MTIMEtimestamp_add(&thgh, &thgh, &one)) != 
MAL_SUCCEED)
+                               return msg;
+                       if( !li && !timestamp_isnil(tlow) &&
+                           (msg = MTIMEtimestamp_add(&tlow, &tlow, &one)) != 
MAL_SUCCEED)
+                               return msg;
 
                        /* casting one value to lng causes the whole
                         * computation to be done as lng, reducing the
@@ -633,7 +635,8 @@ str VLTgenerator_thetasubselect(Client c
                        if ( strcmp(oper,"<") == 0){
                                lng minone = -1;
                                hgh= *getArgReference_TYPE(stk,pci,idx, 
timestamp);
-                               MTIMEtimestamp_add(&hgh, &hgh, &minone);
+                               if ((msg = MTIMEtimestamp_add(&hgh, &hgh, 
&minone)) != MAL_SUCCEED)
+                                       return msg;
                        } else
                        if ( strcmp(oper,"<=") == 0){
                                hgh= *getArgReference_TYPE(stk,pci,idx, 
timestamp) ;
@@ -641,7 +644,8 @@ str VLTgenerator_thetasubselect(Client c
                        if ( strcmp(oper,">") == 0){
                                lng one = 1;
                                low= *getArgReference_TYPE(stk,pci,idx, 
timestamp);
-                               MTIMEtimestamp_add(&hgh, &hgh, &one);
+                               if ((msg = MTIMEtimestamp_add(&hgh, &hgh, 
&one)) != MAL_SUCCEED)
+                                       return msg;
                        } else
                        if ( strcmp(oper,">=") == 0){
                                low= *getArgReference_TYPE(stk,pci,idx, 
timestamp);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to