List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 24 2007 2:07am
Subject:Rev 196: Fixed getAutoIncrementValue() to not segfault when it tries to throw an exception. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connect...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 196
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Tue 2007-10-23 19:07:06 -0700
message:
  Fixed getAutoIncrementValue() to not segfault when it tries to throw an exception.
modified:
  swig/Ndb.i                     ndb.i-20070228021421-qkr4cbpxymyqdrf3-1
=== modified file 'swig/Ndb.i'
--- a/swig/Ndb.i	2007-10-24 00:21:46 +0000
+++ b/swig/Ndb.i	2007-10-24 02:07:06 +0000
@@ -105,9 +105,10 @@
 public:
   %ndbexception("NdbApiException") {
     $action
-      if (result==0) { 
+      if (result==(Uint64)-1) { 
 	NdbError err = arg1->getNdbError();
 	NDB_exception_err(NdbApiException,err.message,err);
+	return NULL;
       }
   }
   Uint64 getAutoIncrementValue(const char* aTableName,
@@ -116,7 +117,7 @@
     Uint64 id = 0;
     int ret = self->getAutoIncrementValue(aTableName,id,cacheSize);
     if (ret == -1) {
-      return (Uint64)0;
+      return (Uint64)-1;
     }
     return id;
   };
@@ -126,7 +127,7 @@
     Uint64 id = 0;
     int ret = self->getAutoIncrementValue(myTable,id,cacheSize);
     if (ret == -1) {
-      return (Uint64)0;
+      return (Uint64)-1;
     }
     return id;
   };

Thread
Rev 196: Fixed getAutoIncrementValue() to not segfault when it tries to throw an exception. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connect...Monty Taylor24 Oct