Changeset: bbced4fe27f0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bbced4fe27f0
Modified Files:
        sql/server/sql_atom.c
Branch: Oct2020
Log Message:

Clear GDK error buffer before returning


diffs (63 lines):

diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c
--- a/sql/server/sql_atom.c
+++ b/sql/server/sql_atom.c
@@ -1280,8 +1280,10 @@ atom_neg(atom *a)
                return 0;
        VALempty(&dst);
        dst.vtype = a->data.vtype;
-       if (VARcalcnegate(&dst, &a->data) != GDK_SUCCEED)
+       if (VARcalcnegate(&dst, &a->data) != GDK_SUCCEED) {
+               GDKclrerr();
                return -1;
+       }
        a->data = dst;
        return 0;
 }
@@ -1313,8 +1315,10 @@ atom_add(atom *a1, atom *a2)
                a2 = t;
        }
        dst.vtype = a1->tpe.type->localtype;
-       if (VARcalcadd(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED)
+       if (VARcalcadd(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED) {
+               GDKclrerr();
                return NULL;
+       }
        a1->data = dst;
        if (a1->isnull || a2->isnull)
                a1->isnull = 1;
@@ -1334,8 +1338,10 @@ atom_sub(atom *a1, atom *a2)
                dst.vtype = a2->tpe.type->localtype;
        else
                dst.vtype = a1->tpe.type->localtype;
-       if (VARcalcsub(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED)
+       if (VARcalcsub(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED) {
+               GDKclrerr();
                return NULL;
+       }
        if (a1->tpe.type->localtype < a2->tpe.type->localtype ||
            (a1->tpe.type->localtype == a2->tpe.type->localtype &&
             a1->tpe.digits < a2->tpe.digits))
@@ -1365,8 +1371,10 @@ atom_mul(atom *a1, atom *a2)
                return a1;
        }
        dst.vtype = a1->tpe.type->localtype;
-       if (VARcalcmul(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED)
+       if (VARcalcmul(&dst, &a1->data, &a2->data, 1) != GDK_SUCCEED) {
+               GDKclrerr();
                return NULL;
+       }
        a1->data = dst;
        a1->tpe.digits += a2->tpe.digits;
        return a1;
@@ -1380,8 +1388,10 @@ atom_inc(atom *a)
        if (a->isnull)
                return -1;
        dst.vtype = a->data.vtype;
-       if (VARcalcincr(&dst, &a->data, 1) != GDK_SUCCEED)
+       if (VARcalcincr(&dst, &a->data, 1) != GDK_SUCCEED) {
+               GDKclrerr();
                return -1;
+       }
        a->data = dst;
        return 0;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to