Description:
Doing a  primary key read on a tuple that does not exists is not correctly handled by NdbResultSet.
NdbResultSet.next() returns true even though the row does not exist.
--
NDB: mysql-5.1.27 ndb-6.3.17
OS: Ubuntu 8.04, 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux
Java: "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)
How to repeat:
NdbOperation operation = transaction.getSelectOperation(NDBJUtil.SIMPLE_TABLE_NAME,
					NdbOperation.LockMode.LM_CommittedRead);
int id = 30;
operation.equalInt("id", id);
operation.getValue("firstname");
operation.getValue("lastname");
transaction.execute(ExecType.Commit, AbortOption.AbortOnError, true);
NdbResultSet rs = operation.resultData();
if (rs.next()) {
  String firstName = rs.getString("firstname");
  String lastName = rs.getString("lastname");
  System.out.println("ID:" + id + ", FIRSTNAME: " + firstName + ", LASTNAME: " + lastName);
} else {
  System.out.println("No user found.");
}
  
 
 
Description: Doing a primary key read on a tuple that does not exists is not correctly handled by NdbResultSet. NdbResultSet.next() returns true even though the row does not exist. -- NDB: mysql-5.1.27 ndb-6.3.17 OS: Ubuntu 8.04, 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux Java: "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing) How to repeat: NdbOperation operation = transaction.getSelectOperation(NDBJUtil.SIMPLE_TABLE_NAME, NdbOperation.LockMode.LM_CommittedRead); int id = 30; operation.equalInt("id", id); operation.getValue("firstname"); operation.getValue("lastname"); transaction.execute(ExecType.Commit, AbortOption.AbortOnError, true); NdbResultSet rs = operation.resultData(); if (rs.next()) { String firstName = rs.getString("firstname"); String lastName = rs.getString("lastname"); System.out.println("ID:" + id + ", FIRSTNAME: " + firstName + ", LASTNAME: " + lastName); } else { System.out.println("No user found."); }