EXECUTE BLOCK statement and ISC_DSQL_EXECUTE2() problem. --------------------------------------------------------
Key: CORE-3680 URL: http://tracker.firebirdsql.org/browse/CORE-3680 Project: Firebird Core Issue Type: Bug Components: API / Client Library, Engine Affects Versions: 2.5.1 Environment: Using IB Objects in a Win32 environment. Reporter: Jason Wharton It seems that Firebird 2.5 has an issue where repeated executions of an EXECUTE BLOCK statement are not possible via ISC_DSQL_EXECUTE2() due to the error: "Attempt to reopen an open cursor" Here is a trace in IB Objects (using a TIB_DSQL component) of what happened: /*--- ALLOCATE STATEMENT DB_HANDLE = 1 STMT_HANDLE = 188 ----*/ /*--- PREPARE STATEMENT TR_HANDLE = 186 STMT_HANDLE = 188 EXECUTE BLOCK RETURNS (I INTEGER) AS BEGIN SELECT FIRST 1 MON$ATTACHMENT_ID FROM MON$ATTACHMENTS INTO :I; EXIT; END PLAN (MON$ATTACHMENTS NATURAL) FIELDS = [ Version 1 SQLd 1 SQLn 30 I = <NIL> ] SECONDS = 0.016 ----*/ /*--- STATEMENT INFO STMT_HANDLE = 188 ----*/ /*--- STATEMENT INFO STMT_HANDLE = 188 ----*/ /*--- EXECUTE2 ROW SINGLETON TR_HANDLE = 186 STMT_HANDLE = 188 PARAMS = [ ] FIELDS = [ Version 1 SQLd 1 SQLn 1 I = 53765 ] ----*/ /*--- EXECUTE2 ROW SINGLETON TR_HANDLE = 186 STMT_HANDLE = 188 PARAMS = [ ] FIELDS = [ Version 1 SQLd 1 SQLn 1 I = 53765 ] ERRCODE = 335544569 ----*/ /*--- INTERPRET BUFFER = ERRCODE = 17 ----*/ /*--- INTERPRET BUFFER = Dynamic SQL Error ERRCODE = 21 ----*/ /*--- INTERPRET BUFFER = SQL error code = -502 ERRCODE = 32 ----*/ /*--- INTERPRET BUFFER = Attempt to reopen an open cursor ERRCODE = -1 ----*/ /*--- COMMIT TR_HANDLE = 186 ----*/ The call shown as EXECUTE2 ROW SINGLETON is the isc_dsql_execute2() API call. Thanks to anyone who can do a low-level verification of this. It seems to me there shouldn't be an error here. Thanks, Jason Wharton -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel