Bug #35431 Transaction object created and unreleased by extra call to nextResult()
Submitted: 19 Mar 2008 11:23 Modified: 28 Aug 2012 8:27
Reporter: David Shrewsbury Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S3 (Non-critical)
Version:mysql-5.1 OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any
Tags: 5.1+, ndbapi, NdbScanOperation, nextResult(), transactions

[19 Mar 2008 11:23] David Shrewsbury
Description:
Calling nextResult() after it has already returned 1 (no more tuples found) creates a transaction object that is never released until the NDB API application terminates.

Note that it is a application programming error to make this unnecessary call to nextResult(), so the problem is easily avoidable, but the transaction object that is created by this extra call should still be released.

Tested and verified on 5.1.23-rc.

How to repeat:
Use the default value for MaxNoOfConcurrentTransactions and create a Cluster table with the following definition:

CREATE TABLE a (col1 INT NOT NULL PRIMARY KEY, col2 INT) ENGINE=NDB;
INSERT INTO a VALUES (1,10), (2,20), (3,30);

Then run the program produced from the uploaded ndb_scan.cc program.

The output should be similar to:

iteration 1
iteration 2
...
iteration 8126
iteration 8127
Error in ndb_scan.cc, line: 118, code: 4006, msg: Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions).
[19 Mar 2008 11:23] David Shrewsbury
C/C++ code that reproduces the problem

Attachment: ndb_scan.cc (text/x-c++src), 4.07 KiB.

[20 Mar 2008 7:25] Jon Stephens
Following discussion with Gustaf this morning, it appears that this is probably best addressed by a "friendly warning" in the Cluster API docs à la "If you mess up and do this thing you're not really supposed to do, this potentially Bad (or at least Annoying) Thing could happen...".

Changed category to Docs, assigned to myself, set Stefan as lead.
[20 Mar 2008 14:14] Jon Stephens
Discussed with Jonas; he feels that this is due primarily to an abuse of the API and we shouldn't document it as a special case. Changed Category back to NDBAPI and assigned to Jonas at his request; set Tomas as lead.
[28 Aug 2012 8:27] Jon Stephens
Fixed in NDB 6.3.49, 7.0.34, 7.1.23, and 7.2.7.

Closed.