Issue Details (XML | Word | Printable)

Key: CORE-4313
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Alexander Potapchenko
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Error "Attempt to reopen an open cursor" may be raised if the query handle is reused in a different transaction

Created: 05/Jan/14 04:22 PM   Updated: 18/Jan/16 03:32 PM
Component/s: Engine
Affects Version/s: 3.0 Alpha 1, 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

QA Status: No test


 Description  « Hide
Call sequence that demonstrates the issue:

isc_dsql_allocate_statement(status, &db, &st);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);
isc_dsql_prepare(status, &tr, &st, 0, "select 1 from rdb$relations", 1, sqlda);

isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_commit_transaction(status, &tr);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);

isc_dsql_free_statement(status, &st, DSQL_close);

-- here error is raised
isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_dsql_free_statement(status, &st, DSQL_drop);
isc_commit_transaction(status, &tr);

The issue is caused by the cursor not being explicitly closed before transaction commit/rollback. It worked in prior versions, but in v3.0 this sequence leads to leftover cursor pointers causing the error to be thrown.

P.S. Given the known details, I'm not sure it's the same issue as CORE-3984.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov made changes - 05/Jan/14 04:23 PM
Field Original Value New Value
Assignee Dmitry Yemanov [ dimitr ]
Reporter Dmitry Yemanov [ dimitr ] Alexander Potapchenko [ lightfore ]
Dmitry Yemanov made changes - 05/Jan/14 04:25 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0 Beta 1 [ 10332 ]
Resolution Fixed [ 1 ]
Pavel Cisar made changes - 22/Sep/15 09:39 AM
Status Resolved [ 5 ] Closed [ 6 ]
Pavel Zotov made changes - 18/Jan/16 03:32 PM
Status Closed [ 6 ] Closed [ 6 ]
QA Status No test