At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
------------------------------------------------------------
revno: 163
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Sun 2007-09-30 14:21:46 -0700
message:
Finshed the major part of *ref/*impl merge. Basic tests pass now.
Implemented equal methods as compat-upgrade layer.
Actually instantiate the resultSet HashMap.
modified:
java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java
ndbbaseoperationequa-20070517181935-98huwjarzuh25b30-6
java/com/mysql/cluster/ndbj/NdbScanOperation.java
ndbscanoperation.jav-20070517181935-98huwjarzuh25b30-25
java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java
ndbscanoperationimpl-20070517181935-98huwjarzuh25b30-26
java/com/mysql/cluster/ndbj/NdbTransaction.java
ndbtransaction.java-20070517181935-98huwjarzuh25b30-27
java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java
joinusingscanandinde-20070517181935-98huwjarzuh25b30-37
java/ndbj.i ndbj.i-20070913223244-5938mztpztyn9sry-1
java/testsuite/ndbj/NdbIndexScanOperationUtf8Latin1Test.java
ndbindexscanoperatio-20070517181935-98huwjarzuh25b30-51
java/testsuite/ndbj/NdbOperationIDTest.java
ndboperationidtest.j-20070517181935-98huwjarzuh25b30-53
java/testsuite/ndbj/NdbOperationTest.java
ndboperationtest.jav-20070517181935-98huwjarzuh25b30-55
java/testsuite/ndbj/NdbOperationsFailedTest.java
ndboperationsfailedt-20070517181935-98huwjarzuh25b30-56
swig/NdbScanOperation.i ndbscanoperation.i-20070228021421-qkr4cbpxymyqdrf3-5
swig/NdbTransaction.i ndbtransaction.i-20070227184716-ecjyhh3jgvmye4de-7
=== modified file 'java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java'
--- a/java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java 2007-09-30 02:39:45 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbBaseOperationEquals.java 2007-09-30 21:21:46 +0000
@@ -33,6 +33,8 @@
* @throws NdbApiRuntimeException If a bad columnName is entered
*/
public int equalInt(long columnId, int val) throws NdbApiException;
+ @Deprecated
+ public int equal(long columnId, int val) throws NdbApiException;
/**
* This method defines a search condition for a tuple using equality, i.e., a row where
@@ -46,7 +48,8 @@
* @throws NdbApiRuntimeException If a bad columnName is entered
*/
public int equalInt(String columnName, int val) throws NdbApiException;
-
+ @Deprecated
+ public int 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'.
@@ -59,6 +62,8 @@
* @throws NdbApiRuntimeException If a bad columnName is entered
*/
public int equalString(long columnId, String val) throws NdbApiException;
+ @Deprecated
+ public int equal(long columnId, String val) throws NdbApiException;
/**
* This method defines a search condition for a tuple using equality, i.e., a row where
@@ -82,6 +87,8 @@
* @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;
/**
@@ -92,6 +99,8 @@
* @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;
/**
*
@@ -101,6 +110,8 @@
* @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;
/**
*
@@ -110,6 +121,8 @@
* @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;
/**
*
@@ -119,6 +132,8 @@
* @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
@@ -137,6 +152,7 @@
*/
public int equalUint(long columnId, long val) throws NdbApiException;
+
/**
*
* @param columnName name of the Column in the Schema
@@ -145,7 +161,9 @@
* @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)
@@ -154,7 +172,8 @@
* @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;
/**
@@ -165,8 +184,8 @@
* @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')
@@ -174,8 +193,8 @@
* @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
@@ -184,7 +203,9 @@
* @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)
@@ -193,7 +214,8 @@
* @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;
/**
*
@@ -203,6 +225,7 @@
*/
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)
=== modified file 'java/com/mysql/cluster/ndbj/NdbScanOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbScanOperation.java 2007-09-30 02:06:41 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbScanOperation.java 2007-09-30 21:21:46 +0000
@@ -76,6 +76,9 @@
private ScanFlag(int type) {
this.type = type;
}
+ public int swigValue() {
+ return this.type;
+ }
}
@@ -93,8 +96,7 @@
* @throws NdbApiException if the object has been closed or if readTuples failed
*/
public abstract int readTuples(LockMode mode) throws NdbApiException;
- public abstract int readTuples(LockMode mode, long parallel,
- long batch) throws NdbApiException;
+
/**
* This method is used to perform a scan operation that reads many rows from a table
without using an index.
@@ -110,7 +112,7 @@
* Use 0 to specify the maximum automatically.
* @throws NdbApiException if the object has been closed or if readTuples failed
*/
- public abstract int readTuples(LockMode mode, long scanFlag, long parallel,
+ public abstract int readTuples(LockMode mode, ScanFlag scanFlag, long parallel,
long batch) throws NdbApiException;
=== modified file 'java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java'
--- a/java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java 2007-09-30 02:06:41 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbScanOperationImpl.java 2007-09-30 21:21:46 +0000
@@ -33,16 +33,16 @@
return new NdbScanFilterImpl(this);
}
- public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags, long parallel,
long batch) throws NdbApiException {
- return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_0(swigCPtr, this,
lock_mode.swigValue(), scan_flags, parallel, batch);
- }
-
- public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags, long parallel)
throws NdbApiException {
- return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_1(swigCPtr, this,
lock_mode.swigValue(), scan_flags, parallel);
- }
-
- public int readTuples(NdbOperation.LockMode lock_mode, long scan_flags) throws
NdbApiException {
- return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_2(swigCPtr, this,
lock_mode.swigValue(), scan_flags);
+ public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags, long parallel, long batch) throws NdbApiException {
+ return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_0(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue(), parallel, batch);
+ }
+
+ public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags, long parallel) throws NdbApiException {
+ return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_1(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue(), parallel);
+ }
+
+ public int readTuples(NdbOperation.LockMode lock_mode, NdbScanOperation.ScanFlag
scan_flags) throws NdbApiException {
+ return ndbjJNI.NdbScanOperationImpl_readTuples__SWIG_2(swigCPtr, this,
lock_mode.swigValue(), scan_flags.swigValue());
}
public int readTuples(NdbOperation.LockMode lock_mode) throws NdbApiException {
@@ -132,4 +132,48 @@
return (cPtr == 0) ? null : new NdbScanFilterRef(cPtr, false);
}
+ public enum ScanFlag {
+ SF_TupScan(ndbjJNI.NdbScanOperationImpl_SF_TupScan_get()),
+ SF_DiskScan(ndbjJNI.NdbScanOperationImpl_SF_DiskScan_get()),
+ SF_OrderBy(ndbjJNI.NdbScanOperationImpl_SF_OrderBy_get()),
+ SF_Descending(ndbjJNI.NdbScanOperationImpl_SF_Descending_get()),
+ SF_ReadRangeNo(ndbjJNI.NdbScanOperationImpl_SF_ReadRangeNo_get()),
+ SF_MultiRange(ndbjJNI.NdbScanOperationImpl_SF_MultiRange_get()),
+ SF_KeyInfo(ndbjJNI.NdbScanOperationImpl_SF_KeyInfo_get());
+
+ public final int swigValue() {
+ return swigValue;
+ }
+
+ public static ScanFlag swigToEnum(int swigValue) {
+ ScanFlag[] swigValues = ScanFlag.class.getEnumConstants();
+ if (swigValue < swigValues.length && swigValue >= 0 &&
swigValues[swigValue].swigValue == swigValue)
+ return swigValues[swigValue];
+ for (ScanFlag swigEnum : swigValues)
+ if (swigEnum.swigValue == swigValue)
+ return swigEnum;
+ throw new IllegalArgumentException("No enum " + ScanFlag.class + " with value " +
swigValue);
+ }
+
+ private ScanFlag() {
+ this.swigValue = SwigNext.next++;
+ }
+
+ private ScanFlag(int swigValue) {
+ this.swigValue = swigValue;
+ SwigNext.next = swigValue+1;
+ }
+
+ private ScanFlag(ScanFlag swigEnum) {
+ this.swigValue = swigEnum.swigValue;
+ SwigNext.next = this.swigValue+1;
+ }
+
+ private final int swigValue;
+
+ private static class SwigNext {
+ private static int next = 0;
+ }
+ }
+
}
=== modified file 'java/com/mysql/cluster/ndbj/NdbTransaction.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransaction.java 2007-09-30 02:06:41 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransaction.java 2007-09-30 21:21:46 +0000
@@ -171,7 +171,7 @@
* @throws IllegalStateException if the close method has already been called on the
object.
*/
- public NdbIndexOperation getNdbIndexOperation(NdbImpl theNdb, String indexName, String
tableName) throws NdbApiException;
+ public NdbIndexOperation getNdbIndexOperation(String indexName, String tableName) throws
NdbApiException;
public NdbIndexOperation getNdbIndexOperation(NdbIndex theIndex) throws NdbApiException;
/**
@@ -184,7 +184,7 @@
* @throws NdbApiException if tableName or indexName is null or empty, the object has
been closed, or the Operation object could not be created
* @throws IllegalStateException if the close method has already been called on the
object.
*/
- public NdbIndexScanOperation getNdbIndexScanOperation(NdbImpl theNdb, String indexName,
String tableName) throws NdbApiException;
+ public NdbIndexScanOperation getNdbIndexScanOperation(String indexName, String
tableName) throws NdbApiException;
public NdbIndexScanOperation getNdbIndexScanOperation(
NdbIndex theIndex) throws NdbApiException;
=== modified file 'java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java'
--- a/java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java 2007-09-17
01:09:47 +0000
+++ b/java/com/mysql/cluster/ndbj/examples/JoinUsingScanAndIndexScan.java 2007-09-30
21:21:46 +0000
@@ -9,7 +9,6 @@
import com.mysql.cluster.ndbj.NdbFactory;
import com.mysql.cluster.ndbj.NdbIndexScanOperation;
import com.mysql.cluster.ndbj.NdbOperation;
-import com.mysql.cluster.ndbj.NdbOperationRef;
import com.mysql.cluster.ndbj.NdbResultSet;
import com.mysql.cluster.ndbj.NdbScanOperation;
import com.mysql.cluster.ndbj.NdbTransaction;
@@ -214,7 +213,8 @@
NdbScanOperation op_a = trans.getNdbScanOperation("ndbj_join_a");
- op_a.readTuples(NdbOperation.LockMode.LM_CommittedRead,0,0);
+ // TODO: readTuples needs work
+
op_a.readTuples(NdbOperation.LockMode.LM_CommittedRead,NdbScanOperation.ScanFlag.TUPLE_SCAN,0,0);
op_a.getValue("id");
NdbResultSet rs_a = op_a.resultData();
=== modified file 'java/ndbj.i'
--- a/java/ndbj.i 2007-09-30 02:39:45 +0000
+++ b/java/ndbj.i 2007-09-30 21:21:46 +0000
@@ -39,7 +39,6 @@
%{
#include <stdio.h>
-//#include <iostream>
typedef struct
asynch_callback_t
@@ -322,21 +321,76 @@
%}
-//%typemap(jstype) Ndb_cluster_connection * "NdbClusterConnection"
-//%typemap(javain) Ndb_cluster_connection *
"NdbClusterConnectionImpl.getCPtr((NdbClusterConnectionImpl)$javainput)"
%typemap(javainterfaces) Ndb_cluster_connection "NdbClusterConnection";
%include "NdbClusterConnection.i"
- //%typemap(jstype) Ndb * "Ndb"
%typemap(javainterfaces) Ndb "Ndb";
+/*
+%rename(realStartTransaction) Ndb::startTransaction;
+%javamethodmodifiers Ndb::startTransaction "protected"
+%typemap(javacode) Ndb %{
+
+ public NdbTransactionImpl startTransaction(NdbTable table, String keyData, long keyLen)
throws NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction(table,keyData,keyLen);
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+
+ public NdbTransactionImpl startTransaction(NdbTable table, String keyData) throws
NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction(table,keyData);
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+
+ public NdbTransactionImpl startTransaction(NdbTable table) throws NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction(table);
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+
+ public NdbTransactionImpl startTransaction() throws NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction();
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+ public NdbTransactionImpl startTransaction(String aTableName, int keyData) throws
NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction(aTableName,keyData);
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+ public NdbTransactionImpl startTransaction(String aTableName, String keyData) throws
NdbApiException {
+ NdbTransactionImpl theTrans = realStartTransaction(aTableName,keyData);
+ theTrans.theNdb = this;
+ return theTrans;
+ }
+
+ %}
+*/
%include "Ndb.i"
%include "NdbDictionary.i"
- //%typemap(jstype) NdbTransaction * "NdbTransaction"
%typemap(javainterfaces) NdbTransaction "NdbTransaction";
+/*
+%javamethodmodifiers NdbTransaction::getNdbIndexOperation(Ndb*, const char*, const char*)
"protected";
+%javamethodmodifiers NdbTransaction::getNdbIndexScanOperation(Ndb*, const char*, const
char*) "protected";
+%rename(realGetNdbIndexOperation) getNdbIndexOperation(Ndb*, const char*, const char*);
+%rename(realGetNdbIndexScanOperation) getNdbIndexScanOperation(Ndb*, const char*, const
char*);
+
+%typemap(javacode) NdbTransaction %{
+ protected NdbImpl theNdb;
+
+ public NdbIndexOperation getNdbIndexOperation(String indexName, String tableName)
throws NdbApiException {
+ return realGetNdbIndexOperation(theNdb,indexName,tableName);
+ }
+ public NdbIndexScanOperation getNdbIndexScanOperation(String indexName, String
tableName) throws NdbApiException {
+ return realGetNdbIndexScanOperation(theNdb,indexName,tableName);
+ }
+ %}
+*/
+
%include "NdbTransaction.i"
%extend NdbTransaction {
@@ -349,6 +403,70 @@
%typemap(javainterfaces) NdbOperation "NdbOperation,NdbInterpretedOperation";
%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);
+}
+ %}
+
+%typemap(javaimports) NdbOperation %{
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.math.BigInteger;
+ %}
%javamethodmodifiers NdbScanOperation::getNdbScanFilter "protected";
%rename(realGetNdbScanFilter) getNdbScanFilter();
@@ -373,6 +491,12 @@
}
%include "NdbOperation.i"
+
+%typemap(jstype) NdbScanOperation::ScanFlag "NdbScanOperation.ScanFlag"
+%typemap(javaout) NdbScanOperation::ScanFlag {
+ return
NdbScanOperation.ScanFlag.swigToEnum(ndbjJNI.NdbScanOperationImpl_getScanFlag(swigCPtr,
this));
+}
+
%include "NdbScanOperation.i"
%include "NdbIndexOperation.i"
@@ -394,12 +518,10 @@
%include "NdbEventOperation.i"
- //%typemap(jstype) NdbRecAttr * "NdbRecAttr"
%typemap(javainterfaces) NdbRecAttr "NdbRecAttr";
%include "NdbRecAttr.i"
- //%typemap(jstype) NdbBlob * "NdbBlob"
%typemap(javainterfaces) NdbBlob "NdbBlob";
%typemap(jstype) NdbBlob::State "NdbBlob.State"
=== modified file 'java/testsuite/ndbj/NdbIndexScanOperationUtf8Latin1Test.java'
--- a/java/testsuite/ndbj/NdbIndexScanOperationUtf8Latin1Test.java 2007-09-17 01:09:47
+0000
+++ b/java/testsuite/ndbj/NdbIndexScanOperationUtf8Latin1Test.java 2007-09-30 21:21:46
+0000
@@ -181,8 +181,8 @@
op.readTuples(NdbOperation.LockMode.LM_Exclusive,0,0);
- op.setBound(col1,NdbIndexScanOperation.BoundType.BoundGE,col1Val);
- op.setBound(col2,NdbIndexScanOperation.BoundType.BoundGE,col2Val);
+ op.setBoundString(col1,NdbIndexScanOperation.BoundType.BoundGE,col1Val);
+ op.setBoundString(col2,NdbIndexScanOperation.BoundType.BoundGE,col2Val);
op.getValue(col3);
NdbResultSet rs = op.resultData();
=== modified file 'java/testsuite/ndbj/NdbOperationIDTest.java'
--- a/java/testsuite/ndbj/NdbOperationIDTest.java 2007-09-17 01:09:47 +0000
+++ b/java/testsuite/ndbj/NdbOperationIDTest.java 2007-09-30 21:21:46 +0000
@@ -131,7 +131,7 @@
op.setBytes(col11, binary_val);
- op.setShort(col12, short_val);
+ op.setInt(col12, short_val);
System.out.println("Going to execute Insert: ("+int_val+", "+varcharlong_val + ", " +
float_val + ", " + double_val + ", " + long_val + ")");
@@ -287,7 +287,7 @@
op.setBytes(col11, binary_val);
short_val+=3;
- op.setShort(col12, short_val);
+ op.setInt(col12, short_val);
trans.execute(ExecType.Commit,
AbortOption.AbortOnError,
=== modified file 'java/testsuite/ndbj/NdbOperationTest.java'
--- a/java/testsuite/ndbj/NdbOperationTest.java 2007-09-17 01:09:47 +0000
+++ b/java/testsuite/ndbj/NdbOperationTest.java 2007-09-30 21:21:46 +0000
@@ -117,7 +117,7 @@
op.setBytes(col11, binary_val);
- op.setShort(col12, short_val);
+ op.setInt(col12, short_val);
System.out.println("Going to execute Insert: ("+int_val+", "+varcharlong_val + ", " +
float_val + ", " + double_val + ", " + long_val + ")");
@@ -271,7 +271,7 @@
op.setBytes(col11, binary_val);
short_val+=3;
- op.setShort(col12, short_val);
+ op.setInt(col12, short_val);
trans.execute(ExecType.Commit,
AbortOption.AbortOnError,
=== modified file 'java/testsuite/ndbj/NdbOperationsFailedTest.java'
--- a/java/testsuite/ndbj/NdbOperationsFailedTest.java 2007-09-17 01:09:47 +0000
+++ b/java/testsuite/ndbj/NdbOperationsFailedTest.java 2007-09-30 21:21:46 +0000
@@ -85,7 +85,7 @@
do {
++opCount;
- } while ((completedOp = trans.getNextCompletedOperation(completedOp)) != null);
+ } while ((completedOp =
trans.getNextCompletedOperation((com.mysql.cluster.ndbj.NdbOperationImpl)completedOp)) !=
null);
assertTrue((opCount==NUM_INSERTS+2));
System.out.println("Number of completed operations was: " + opCount);
=== modified file 'swig/NdbScanOperation.i'
--- a/swig/NdbScanOperation.i 2007-09-30 02:39:45 +0000
+++ b/swig/NdbScanOperation.i 2007-09-30 21:21:46 +0000
@@ -27,6 +27,16 @@
public:
+ enum ScanFlag {
+ SF_TupScan = (1 << 16), // scan TUP order
+ SF_DiskScan = (2 << 16), // scan in DISK order
+ SF_OrderBy = (1 << 24), // index scan in order
+ SF_Descending = (2 << 24), // index scan in descending order
+ SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no
+ SF_MultiRange = (8 << 24), // scan is part of multi-range scan
+ SF_KeyInfo = 1 // request KeyInfo to be sent back
+ };
+
%ndbexception("NdbApiException") {
$action
if (result==-1) {
@@ -36,7 +46,7 @@
}
virtual int readTuples(LockMode lock_mode = LM_Read,
- Uint32 scan_flags = 0, Uint32 parallel = 0, Uint32 batch = 0);
+ ScanFlag scan_flags = 0, Uint32 parallel = 0, Uint32 batch = 0);
int nextResult(bool fetchAllowed = true, bool forceSend = false);
int deleteCurrentTuple();
int deleteCurrentTuple(NdbTransaction* takeOverTransaction);
=== modified file 'swig/NdbTransaction.i'
--- a/swig/NdbTransaction.i 2007-09-30 02:06:41 +0000
+++ b/swig/NdbTransaction.i 2007-09-30 21:21:46 +0000
@@ -36,10 +36,20 @@
NdbOperation* getNdbOperation(const class NdbDictTable* aTable);
NdbOperation* getNdbOperation(const char* aTableName);
-
+ /* These first two are deprecated */
+ NdbIndexScanOperation* getNdbIndexScanOperation(const char* anIndexName,
+ const char* aTableName);
+ NdbIndexScanOperation* getNdbIndexScanOperation
+ (const NdbDictionary::Index *anIndex, const NdbDictTable *aTable);
NdbIndexScanOperation* getNdbIndexScanOperation(const NdbDictIndex *anIndex);
+
+ NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
+ const char* aTableName);
+ NdbIndexOperation* getNdbIndexOperation(const NdbDictIndex *anIndex,
+ const NdbDictTable *aTable);
NdbIndexOperation* getNdbIndexOperation(const NdbDictIndex *anIndex);
-
+
+
NdbScanOperation* getNdbScanOperation(const class NdbDictTable* aTable);
NdbScanOperation* getNdbScanOperation(const char* aTableName);
NdbOperation* getNdbErrorOperation();
@@ -103,7 +113,7 @@
}
-
+/*
NdbIndexScanOperation* getNdbIndexScanOperation(Ndb* myNdb,
const char* anIndexName,
const char* aTableName)
@@ -120,7 +130,7 @@
const NdbDictIndex *theIndex= myDict->getIndex(anIndexName,aTableName);
return self->getNdbIndexOperation(theIndex);
}
-
+*/
%ndbnoexception
void executeAsynchPrepare(ExecType execType,
BaseCallback * cb,
| Thread |
|---|
| • Rev 163: Finshed the major part of *ref/*impl merge. Basic tests pass now. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge | Monty Taylor | 30 Sep |