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

Direct fix for bug 6300
The API fix should go to the Default branch


diffs (53 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3479,11 +3479,13 @@ dump_trace(Client cntxt, MalBlkPtr mb, M
        (void) mb;
        if (TRACEtable(t) != 13)
                throw(SQL, "sql.dump_trace", "3F000!Profiler not started");
-       for(i=0; i< 13; i++){
+       for(i=0; i< 13; i++)
+       if( t[i]){
                id = t[i]->batCacheid;
                *getArgReference_bat(stk, pci, i) = id;
                BBPkeepref(id);
-       }
+       } else
+               throw(SQL,"dump_trace","Missing trace BAT ");
        return MAL_SUCCEED;
 }
 
@@ -3502,12 +3504,14 @@ sql_querylog_catalog(Client cntxt, MalBl
        (void) cntxt;
        (void) mb;
        QLOGcatalog(t);
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < 8; i++) 
+       if( t[i]){
                bat id = t[i]->batCacheid;
 
                *getArgReference_bat(stk, pci, i) = id;
                BBPkeepref(id);
-       }
+       } else
+               throw(SQL,"sql.querylog","Missing query catalog BAT");
        return MAL_SUCCEED;
 }
 
@@ -3520,12 +3524,14 @@ sql_querylog_calls(Client cntxt, MalBlkP
        (void) cntxt;
        (void) mb;
        QLOGcalls(t);
-       for (i = 0; i < 9; i++) {
+       for (i = 0; i < 9; i++) 
+       if( t[i]){
                bat id = t[i]->batCacheid;
 
                *getArgReference_bat(stk, pci, i) = id;
                BBPkeepref(id);
-       }
+       } else
+               throw(SQL,"sql.querylog","Missing query call BAT");
        return MAL_SUCCEED;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to