Changeset: 5c7211b9f37d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5c7211b9f37d
Modified Files:
        sql/backends/monet5/datacell/opt_datacell.mx
Branch: default
Log Message:

Catch exceptions.
Continuous queries can also trigger exceptions.
They are captured and ignored.
It may, however, lead to a situation that no
events are eaten away.


diffs (46 lines):

diff --git a/sql/backends/monet5/datacell/opt_datacell.mx 
b/sql/backends/monet5/datacell/opt_datacell.mx
--- a/sql/backends/monet5/datacell/opt_datacell.mx
+++ b/sql/backends/monet5/datacell/opt_datacell.mx
@@ -60,7 +60,7 @@
 {
        int actions = 0, fnd;
     int bskt, i, j, k, limit, vlimit, slimit;
-    InstrPtr p, *old;
+    InstrPtr r, p, *old;
        str  col;
        int maxbasket= 128, m=0,a=0;
        char *tables[128];
@@ -100,6 +100,22 @@
                        /* a good place to commit the SQL transaction */
                        for ( j = 0; j < a; j++)
                                pushInstruction(mb, qa[j]);
+                       /* catch any exception left behind */
+                       r= newAssignment(mb);
+                       j = getArg(r,0)=  
newVariable(mb,GDKstrdup("SQLexception"),TYPE_str);
+                       setVarUDFtype(mb,j);
+                       r->barrier= CATCHsymbol;
+                       r= newAssignment(mb);
+                       getArg(r,0)= j;
+                       r->barrier= EXITsymbol;
+                       r= newAssignment(mb);
+                       j = getArg(r,0)=  
newVariable(mb,GDKstrdup("MALexception"),TYPE_str);
+                       setVarUDFtype(mb,j);
+                       r->barrier= CATCHsymbol;
+                       r= newAssignment(mb);
+                       getArg(r,0)= j;
+                       r->barrier= EXITsymbol;
+                       
                        (void) newFcnCall(mb, sqlRef, commitRef);
                }
                if ( getModuleId(p) == sqlRef  && getFunctionId(p) == 
putName("affectedRows",12)) {
@@ -186,8 +202,8 @@
                                        /* upgrade single values to a BAT */
                                        clrFunction(p);
                                        if ( 
!isaBatType(getVarType(mb,getArg(p,5))) ) {
-                                               getModuleId(p) = batRef;
-                                               getFunctionId(p) = packRef;
+                                               getModuleId(p) = sqlRef;
+                                               getFunctionId(p) = singleRef;
                                        } 
                                        getArg(p, 0) = getArg(qa[j], k + 2);
                                        getArg(p, 1) = getArg(p, 5);
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to