List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:October 23 2007 12:05am
Subject:Rev 189: Added unsigned contract assertions on incValue. Unfortunately there doesn't seem to be a good way to do this other than throwing an exception...
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 189
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Mon 2007-10-22 17:04:00 -0700
message:
  Added unsigned contract assertions on incValue. Unfortunately there doesn't seem to be a
good way to do this other than throwing an exception. :(
  Figured out how to intercept int return types and replace them with void when we're
handling it with exceptions. Applied to incValue and equal* 
modified:
  java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java
ndbbaseoperationequa-20070517181935-98huwjarzuh25b30-6
  java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java
ndbinterpretedoperat-20070930023903-6bxvuqq341exc9er-1
  java/ndbj.i                    ndbj.i-20070913223244-5938mztpztyn9sry-1
  swig/NdbOperation.i            ndboperation.i-20070228021421-qkr4cbpxymyqdrf3-3
  swig/ndbglobals.i              globals.i-20070228021421-qkr4cbpxymyqdrf3-7
=== modified file 'java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java'
--- a/java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java	2007-09-30 21:21:46 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java	2007-10-23 00:04:00 +0000
@@ -32,9 +32,9 @@
      * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
      * @throws NdbApiRuntimeException If a bad columnName is entered
 	 */
-	public int equalInt(long columnId, int val) throws NdbApiException;
+	public void equalInt(long columnId, int val) throws NdbApiException;
 	@Deprecated
-	public int equal(long columnId, int val) throws NdbApiException;
+	public void equal(long columnId, int val) throws NdbApiException;
 
 	/**
 	 * 	This method defines a search condition for a tuple using equality, i.e., a row where
@@ -47,9 +47,9 @@
      * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
      * @throws NdbApiRuntimeException If a bad columnName is entered
 	 */
-	public int equalInt(String columnName, int val) throws NdbApiException;
+	public void equalInt(String columnName, int val) throws NdbApiException;
 	@Deprecated
-	public int equal(String columnName, int val) throws NdbApiException;
+	public void equal(String columnName, int val) throws NdbApiException;
 	/**
 	 * 	This method defines a search condition for a tuple using equality, i.e., a row where
 	 *  the value of its attribute in position columnId is equal to the user-supplied 'val'.
@@ -61,9 +61,9 @@
      * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
      * @throws NdbApiRuntimeException If a bad columnName is entered
 	 */
-	public int equalString(long columnId, String val) throws NdbApiException;
+	public void equalString(long columnId, String val) throws NdbApiException;
 	@Deprecated
-	public int equal(long columnId, String val) throws NdbApiException;
+	public void equal(long columnId, String val) throws NdbApiException;
 
 	/**
 	 * 	This method defines a search condition for a tuple using equality, i.e., a row where
@@ -86,153 +86,153 @@
      * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
      * @throws NdbApiRuntimeException If a bad columnName is entered
 	 */
-	public int equalString(String columnName, String val) throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, String val) throws NdbApiException;
-
-
-	/**
-	 *
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalBytes(long columnId, byte[] val) throws NdbApiException;
-	@Deprecated
-	public int equal(long columnId, byte[] val) throws NdbApiException;
-
-	/**
-	 *
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalBytes(String columnName, byte[] val) throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, byte[] val) throws NdbApiException;
-
-	/**
-	 *
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalLong(String columnName, long val) throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, long val) throws NdbApiException;
-
-	/**
-	 *
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalLong(long columnId, long val) throws NdbApiException;
-	@Deprecated
-	public int equal(long columnId, long val) throws NdbApiException;
-	/**
-	 *
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalUint(String columnName, long val) throws NdbApiException;
-
-	/**
-	 *
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalUint(long columnId, long val) throws NdbApiException;
-
-	
-	/**
-	 *
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalUlong(String columnName, BigInteger val) throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, BigInteger val) throws NdbApiException;
-	
-	/**
-	 *
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-    * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalUlong(long columnId, BigInteger val) throws NdbApiException;
-	@Deprecated
-	public int equal(long columnId, BigInteger val) throws NdbApiException;
-
-
-	/**
-	 * 
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalTimestamp(String columnName, Timestamp val)	throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, Timestamp val)	throws NdbApiException;	/**
-	 * 
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalTimestamp(long columnId, Timestamp  val) throws NdbApiException;
-	@Deprecated
-	public int equal(long columnId, Timestamp  val) throws NdbApiException;
-	/**
-	 * 
-	 * @param columnName name of the Column in the Schema
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalDatetime(String columnName, Calendar val)	throws NdbApiException;
-	@Deprecated
-	public int equal(String columnName, Calendar val)	throws NdbApiException;
-	
-	/**
-	 * 
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
-     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalDatetime(long columnId, Calendar val) throws NdbApiException;
-	@Deprecated
-	public int equal(long columnId, Calendar val) throws NdbApiException;
-
-	/**
-	 * 
-	 * @param columnName name of the Column in the Schema
-	 * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalNull(String columnName)	throws NdbApiException;
-
-
-	/**
-	 * 
-	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
-	 * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
-     * @throws NdbApiRuntimeException If a bad columnName is entered
-	 */
-	public int equalNull(long columnId) throws NdbApiException;
+	public void equalString(String columnName, String val) throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, String val) throws NdbApiException;
+
+
+	/**
+	 *
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalBytes(long columnId, byte[] val) throws NdbApiException;
+	@Deprecated
+	public void equal(long columnId, byte[] val) throws NdbApiException;
+
+	/**
+	 *
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalBytes(String columnName, byte[] val) throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, byte[] val) throws NdbApiException;
+
+	/**
+	 *
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalLong(String columnName, long val) throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, long val) throws NdbApiException;
+
+	/**
+	 *
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalLong(long columnId, long val) throws NdbApiException;
+	@Deprecated
+	public void equal(long columnId, long val) throws NdbApiException;
+	/**
+	 *
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalUint(String columnName, long val) throws NdbApiException;
+
+	/**
+	 *
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalUint(long columnId, long val) throws NdbApiException;
+
+	
+	/**
+	 *
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalUlong(String columnName, BigInteger val) throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, BigInteger val) throws NdbApiException;
+	
+	/**
+	 *
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+    * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+    * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalUlong(long columnId, BigInteger val) throws NdbApiException;
+	@Deprecated
+	public void equal(long columnId, BigInteger val) throws NdbApiException;
+
+
+	/**
+	 * 
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalTimestamp(String columnName, Timestamp val)	throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, Timestamp val)	throws NdbApiException;	/**
+	 * 
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalTimestamp(long columnId, Timestamp  val) throws NdbApiException;
+	@Deprecated
+	public void equal(long columnId, Timestamp  val) throws NdbApiException;
+	/**
+	 * 
+	 * @param columnName name of the Column in the Schema
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalDatetime(String columnName, Calendar val)	throws NdbApiException;
+	@Deprecated
+	public void equal(String columnName, Calendar val)	throws NdbApiException;
+	
+	/**
+	 * 
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @param val the equality value for the column (i.e., 'val' in the SQL  "WHERE
column='val')
+     * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalDatetime(long columnId, Calendar val) throws NdbApiException;
+	@Deprecated
+	public void equal(long columnId, Calendar val) throws NdbApiException;
+
+	/**
+	 * 
+	 * @param columnName name of the Column in the Schema
+	 * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalNull(String columnName)	throws NdbApiException;
+
+
+	/**
+	 * 
+	 * @param columnId integer position (offset) of column number in schema definition
(columnId starts from  position '1' for the first column in a schema)
+	 * @throws NdbApiException if there was a problem in the cluster when trying to find
tuples using this column.
+     * @throws NdbApiRuntimeException If a bad columnName is entered
+	 */
+	public void equalNull(long columnId) throws NdbApiException;
 
 
 }

=== modified file 'java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java	2007-09-30 02:39:45 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbInterpretedOperation.java	2007-10-23 00:04:00 +0000
@@ -2,16 +2,16 @@
 
 public interface NdbInterpretedOperation {
 
-	public abstract int incValueLong(String anAttrName, long aValue)
-			throws NdbApiException;
-
-	public abstract int incValueLong(long anAttrId, long aValue)
-			throws NdbApiException;
-
-	public abstract int incValueUlong(String anAttrName,
+	public abstract void incValueLong(String anAttrName, long aValue)
+			throws NdbApiException;
+
+	public abstract void incValueLong(long anAttrId, long aValue)
+			throws NdbApiException;
+
+	public abstract void incValueUlong(String anAttrName,
 			java.math.BigInteger aValue) throws NdbApiException;
 
-	public abstract int incValueUlong(long anAttrId, java.math.BigInteger aValue)
+	public abstract void incValueUlong(long anAttrId, java.math.BigInteger aValue)
 			throws NdbApiException;
 
 	public abstract int subValueLong(String anAttrName, long aValue)

=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2007-10-19 10:13:10 +0000
+++ b/java/ndbj.i	2007-10-23 00:04:00 +0000
@@ -144,6 +144,12 @@
 %typemap(jstype) event_callback_t * "INdbEventCallable"
 %typemap(javain) event_callback_t * "(Object)$javainput"
 
+%typemap(jtype) voidint "void";
+%typemap(jstype) voidint "void";
+%typemap(javaout) voidint { 
+  $jnicall; 
+}
+
 %typemap(jni) MYSQL_TIME * "jobject"
 %typemap(jtype) MYSQL_TIME * "Object"
 %typemap(jstype) MYSQL_TIME * "java.util.Calendar"
@@ -407,60 +413,60 @@
 %typemap(javabase) NdbOperation "NdbOperationResultsImpl";
 %typemap(javacode) NdbOperation %{
 
-public int equal(long columnId, BigInteger val) throws NdbApiException {
-	return equalUlong(columnId,val);
-}
-
-public int equal(long columnId, byte[] val) throws NdbApiException {
-	return equalBytes(columnId,val);
-}
-
-public int equal(long columnId, Calendar val) throws NdbApiException {
-	return equalDatetime(columnId,val);
-}
-
-public int equal(long columnId, int val) throws NdbApiException {
-	return equalInt(columnId,val);
-}
-
-public int equal(long columnId, long val) throws NdbApiException {
-	return equalLong(columnId,val);
-}
-
-public int equal(long columnId, String val) throws NdbApiException {
-	return equalString(columnId,val);
-}
-
-public int equal(long columnId, Timestamp val) throws NdbApiException {
-	return equalTimestamp(columnId,val);
-}
-
-public int equal(String columnName, BigInteger val) throws NdbApiException {
-	return equalUlong(columnName,val);
-}
-
-public int equal(String columnName, byte[] val) throws NdbApiException {
-	return equalBytes(columnName,val);
-}
-
-public int equal(String columnName, Calendar val) throws NdbApiException {
-	return equalDatetime(columnName,val);
-}
-
-public int equal(String columnName, int val) throws NdbApiException {
-	return equalInt(columnName,val);
-}
-
-public int equal(String columnName, long val) throws NdbApiException {
-	return equalLong(columnName,val);
-}
-
-public int equal(String columnName, String val) throws NdbApiException {
-	return equalString(columnName,val);
-}
-
-public int equal(String columnName, Timestamp val) throws NdbApiException {
-	return equalTimestamp(columnName,val);
+public void equal(long columnId, BigInteger val) throws NdbApiException {
+	equalUlong(columnId,val);
+}
+
+public void equal(long columnId, byte[] val) throws NdbApiException {
+	equalBytes(columnId,val);
+}
+
+public void equal(long columnId, Calendar val) throws NdbApiException {
+	equalDatetime(columnId,val);
+}
+
+public void equal(long columnId, int val) throws NdbApiException {
+	equalInt(columnId,val);
+}
+
+public void equal(long columnId, long val) throws NdbApiException {
+	equalLong(columnId,val);
+}
+
+public void equal(long columnId, String val) throws NdbApiException {
+	equalString(columnId,val);
+}
+
+public void equal(long columnId, Timestamp val) throws NdbApiException {
+	equalTimestamp(columnId,val);
+}
+
+public void equal(String columnName, BigInteger val) throws NdbApiException {
+	equalUlong(columnName,val);
+}
+
+public void equal(String columnName, byte[] val) throws NdbApiException {
+	equalBytes(columnName,val);
+}
+
+public void equal(String columnName, Calendar val) throws NdbApiException {
+	equalDatetime(columnName,val);
+}
+
+public void equal(String columnName, int val) throws NdbApiException {
+	equalInt(columnName,val);
+}
+
+public void equal(String columnName, long val) throws NdbApiException {
+	equalLong(columnName,val);
+}
+
+public void equal(String columnName, String val) throws NdbApiException {
+	equalString(columnName,val);
+}
+
+public void equal(String columnName, Timestamp val) throws NdbApiException {
+	equalTimestamp(columnName,val);
 }
 
  /**
@@ -597,5 +603,3 @@
 %include "NdbError.i"
 %include "NdbScanFilter.i"
 
-
-

=== modified file 'swig/NdbOperation.i'
--- a/swig/NdbOperation.i	2007-10-11 22:00:37 +0000
+++ b/swig/NdbOperation.i	2007-10-23 00:04:00 +0000
@@ -227,24 +227,24 @@
 
   %rename(equalInt) equal(const char *, Int32);
   %rename(equalInt) equal(Uint32, Int32); 
-  int  equal(const char* anAttrName, Int32 aValue);
-  int  equal(Uint32 anAttrId, Int32 aValue);
+  voidint equal(const char* anAttrName, Int32 aValue);
+  voidint equal(Uint32 anAttrId, Int32 aValue);
 
   %rename(equalUint) equal(const char *, Uint32);
   %rename(equalUint) equal(Uint32, Uint32); 
-  int  equal(const char* anAttrName, Uint32 aValue);
-  int  equal(Uint32 anAttrId, Uint32 aValue);
+  voidint equal(const char* anAttrName, Uint32 aValue);
+  voidint equal(Uint32 anAttrId, Uint32 aValue);
 
   %rename(equalLong) equal(const char *, Int64);
   %rename(equalLong) equal(Uint32, Int64); 
-  int  equal(const char* anAttrName, Int64 aValue);
-  int  equal(Uint32 anAttrId, Int64 aValue);
+  voidint equal(const char* anAttrName, Int64 aValue);
+  voidint equal(Uint32 anAttrId, Int64 aValue);
 
   %rename(equalUlong) equal(const char *, Uint64);
   %rename(equalUlong) equal(Uint32, Uint64); 
 
-  int  equal(const char* anAttrName, Uint64 aValue);
-  int  equal(Uint32 anAttrId, Uint64 aValue);
+  voidint equal(const char* anAttrName, Uint64 aValue);
+  voidint equal(Uint32 anAttrId, Uint64 aValue);
 
 
   virtual int readTuple(LockMode);
@@ -268,10 +268,29 @@
   %rename(subValueUlong) subValue(Uint32, Uint64);
 #endif
 
-  int incValue(const char* anAttrName, Uint32 aValue);
-  int incValue(Uint32 anAttrId, Uint32 aValue);
-  int incValue(const char* anAttrName, Uint64 aValue);
-  int incValue(Uint32 anAttrId, Uint64 aValue);
+  %contract incValue(const char* anAttrName, Uint32 aValue) { 
+    require:
+      aValue > 0;
+  }
+  voidint incValue(const char* anAttrName, Uint32 aValue);
+
+  %contract incValue(Uint32 anAttrId, Uint32 aValue) { 
+    require:
+      aValue > 0;
+  }
+  voidint incValue(Uint32 anAttrId, Uint32 aValue);
+
+  %contract incValue(const char* anAttrName, Uint64 aValue) { 
+    require:
+      aValue > 0;
+  }
+  voidint incValue(const char* anAttrName, Uint64 aValue);
+
+  %contract incValue(Uint32 anAttrId, Uint64 aValue ) { 
+    require:
+      aValue > 0;
+  }
+  voidint incValue(Uint32 anAttrId, Uint64 aValue);
 
   int subValue(const char* anAttrName, Uint32 aValue);
   int subValue(const char* anAttrName, Uint64 aValue);
@@ -391,10 +410,10 @@
       }
   }
 
-  int equalNull(const char* anAttrName) {
+  voidint equalNull(const char* anAttrName) {
       return self->equal(anAttrName, (char*)0);
   }
-  int equalNull(Uint32 anAttrId) {
+  voidint equalNull(Uint32 anAttrId) {
       return self->equal(anAttrId, (char*)0);
   }
 
@@ -434,7 +453,7 @@
     free(stringVal);
     return retval;
   }
-  int equalString(const char* anAttrName, const char* anInputString, size_t len) {
+  voidint equalString(const char* anAttrName, const char* anInputString, size_t len) {
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
     char * stringVal = ndbFormatString(theColumn,anInputString,len);
     if (stringVal == NULL) 
@@ -443,7 +462,7 @@
     free(stringVal);
     return retval;
   }
-  int equalString(Uint32 anAttrId, const char* anInputString, size_t len) { 
+  voidint equalString(Uint32 anAttrId, const char* anInputString, size_t len) { 
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
     char * stringVal = ndbFormatString(theColumn,anInputString,len);
     if (stringVal == NULL) 
@@ -524,7 +543,7 @@
   }
 
 
-  int equalBytes(const char* anAttrName, const char* BYTE, size_t len) {
+  voidint equalBytes(const char* anAttrName, const char* BYTE, size_t len) {
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
     char * stringVal = ndbFormatString(theColumn,BYTE,len);
     if (stringVal == NULL) 
@@ -533,7 +552,7 @@
     free(stringVal);
     return retval;
   }
-  int equalBytes(Uint32 anAttrId, const char* BYTE, size_t len) { 
+  voidint equalBytes(Uint32 anAttrId, const char* BYTE, size_t len) { 
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
     char * stringVal = ndbFormatString(theColumn,BYTE,len);
     if (stringVal == NULL) 
@@ -542,7 +561,7 @@
     free(stringVal);
     return retval;
   }
-  int equalDatetime(const char* anAttrName, MYSQL_TIME * anInputDateTime) { 
+  voidint equalDatetime(const char* anAttrName, MYSQL_TIME * anInputDateTime) { 
 
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrName);
     
@@ -552,7 +571,7 @@
     return self->equal(anAttrName,dtval);
 
   }
-  int equalDatetime(Uint32 anAttrId, MYSQL_TIME * anInputDateTime) { 
+  voidint equalDatetime(Uint32 anAttrId, MYSQL_TIME * anInputDateTime) { 
     
     const NdbDictColumn * theColumn = self->getTable()->getColumn(anAttrId);
     
@@ -562,22 +581,22 @@
     return  self->equal(anAttrId,dtval);
     }
 
-  int equalTimestamp(const char* anAttrName, NdbTimestamp anInputTimestamp) { 
+  voidint equalTimestamp(const char* anAttrName, NdbTimestamp anInputTimestamp) { 
 
     return self->equal(anAttrName,anInputTimestamp);
 
   }
-  int equalTimestamp(Uint32 anAttrId, NdbTimestamp anInputTimestamp) { 
+  voidint equalTimestamp(Uint32 anAttrId, NdbTimestamp anInputTimestamp) { 
     
     return  self->equal(anAttrId,anInputTimestamp);
   }
 
-  int equalDecimal(const char* anAttrName, Int64 anInputDecimal) { 
+  voidint equalDecimal(const char* anAttrName, Int64 anInputDecimal) { 
 
     return self->equal(anAttrName,anInputDecimal);
 
   }
-  int equalDecimal(Uint32 anAttrId, Int64 anInputDecimal) { 
+  voidint equalDecimal(Uint32 anAttrId, Int64 anInputDecimal) { 
     
     return  self->equal(anAttrId,anInputDecimal);
   }

=== modified file 'swig/ndbglobals.i'
--- a/swig/ndbglobals.i	2007-09-17 02:39:35 +0000
+++ b/swig/ndbglobals.i	2007-10-23 00:04:00 +0000
@@ -60,6 +60,7 @@
 
 
 
+typedef int voidint; 
 typedef Uint32 NdbTimestamp;
 
 typedef NdbDictionary::Object NdbDictObject;

Thread
Rev 189: Added unsigned contract assertions on incValue. Unfortunately there doesn't seem to be a good way to do this other than throwing an exception...Monty Taylor23 Oct