From: jon Date: April 18 2007 10:35pm Subject: svn commit - mysqldoc@docsrva: r5993 - in trunk: ndbapi refman-5.1 List-Archive: http://lists.mysql.com/commits/24870 Message-Id: <200704182235.l3IMZxcE002740@docsrva.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: jstephens Date: 2007-04-19 00:35:56 +0200 (Thu, 19 Apr 2007) New Revision: 5993 Log: In 5.1.16+, NdbTransaction::execute() returns -1 IFF the transaction actually failed. (Fixes Docs Bug #27852) Modified: trunk/ndbapi/ndb-classes.xml trunk/refman-5.1/news-5.1.xml Modified: trunk/ndbapi/ndb-classes.xml =================================================================== --- trunk/ndbapi/ndb-classes.xml 2007-04-18 21:59:45 UTC (rev 5992) +++ trunk/ndbapi/ndb-classes.xml 2007-04-18 22:35:56 UTC (rev 5993) Changed blocks: 1, Lines Added: 43, Lines Deleted: 0; 1743 bytes @@ -36518,7 +36518,50 @@ + + + In MySQL 5.1.15 and earlier versions, this method returned + -1 for some errors even when the + trasnsaction itself was not aborted; beginning with MySQL + 5.1.16, this method reports a failure if and only + if the transaction was aborted. (This change was + made due to the fact it had been possible to construct cases + where there was no way to determine whether or not a + transaction was actually aborted.) However, the transaction's + error information is still set in such cases to reflect the + actual error code and category. + + + + This means, in the case where a + NoDataFound error is a possibility, you + must now check for it explicitly, for example: + + +Ndb_cluster_connection myConnection; +if( myConnection.connect(4, 5, 1) ) +{ + cout << "Unable to connect to cluster within 30 secs." << endl; + exit(-1); +} + +Ndb myNdb(&myConnection, "test"); + +// define operations... + +myTransaction = myNdb->startTransaction(); + +if(myTransaction->getNdbError().classification == NdbError:NoDataFound) +{ + cout << "No records found." << endl; + // ... +} + +myNdb->closeTransaction(myTransaction); + + +