Issue Details (XML | Word | Printable)

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

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

Bugcheck 249 when attempting to fetch outside the end-of-stream mark for the open PSQL cursor

Created: 02/Oct/08 08:20 AM   Updated: 27/Apr/11 10:53 AM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.0.4, 2.1.1
Fix Version/s: 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Test case:

CREATE TABLE T1 ( F1 SMALLINT );

CREATE PROCEDURE P1
AS
  DECLARE VARIABLE V1 SMALLINT;
  DECLARE C1 CURSOR FOR ( SELECT F1 FROM T1 );
BEGIN
  OPEN C1;
  WHILE (1=1) DO
  BEGIN
       FETCH C1 INTO :V1;
       IF(ROW_COUNT = 1) THEN LEAVE;
  END
  CLOSE C1;
END;

COMMIT;

EXECUTE PROCEDURE P1;

Unsuccessful execution caused by a system error that precludes
successful execution of subsequent statements.
Internal gds software consistency check (pointer page vanished from DPM_next (249), file: dpm.cpp line: 1645).

While this example looks like an intentional infinite loop, I believe we should mirror our API behaviour for such situations and throw an error for the invalid (outside the EOF marker) fetch operation.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 27/Apr/11 10:53 AM
QA test added.