Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat Temporary Table access from ReadOnly Transaction and ReadWrite transaction causes Internal Firebird consistency check (cannot find record back version (291), file: vio.cpp line: 4905) [CORE3959] #4292

Closed
firebird-automations opened this issue Oct 24, 2012 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: acacio2000 (acacio2000)

Duplicates CORE3924

Attachments:
Bug.rar

This error occurs with Firebird 2.5.1 too !!

I create an application with one database connection and two transactions

transaction 1 (readonly) parameters:
read
nowait
rec_version
read_committed

transaction 2 (readwrite) parameters:
write
nowait
rec_version
read_committed

I have a Query Select from one Stored Procedure (FU_X1) access by transaction 1, this Stored Procedure delete all records from temporary table and insert records in temporary table. I started transaction (READ), but never commit it !
I have a second Stored Procedure (SAVE_X1) access by transaction 2, this update records in temporary table. I started transaction, execute Stored Procedure, commit transaction, it´s works fine
But when I try reopen a Query again, cause a corrupted database

Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements.
Internal Firebird consistency check (cannot find record back version (291), file: vio.cpp line: 4905).

DDL:

CREATE GLOBAL TEMPORARY TABLE X1 (
ID INTEGER,
NAME VARCHAR(10)
) ON COMMIT PRESERVE ROWS;

/******************************************************************************/
/*** Stored Procedures ***/
/******************************************************************************/

SET TERM ^ ;

ALTER PROCEDURE FU_X1
RETURNS (
SID INTEGER,
SNAME VARCHAR(10))
AS
begin
delete
from
X1;

insert into X1
values (
1,
'1');
insert into X1
values (
2,
'2');
insert into X1
values (
3,
'3');
insert into X1
values (
4,
'4');
insert into X1
values (
5,
'5');

for
select
http://X1.ID,
http://X1.NAME
from
X1
into
SID,
SNAME
do
suspend;
end^

ALTER PROCEDURE SAVE_X1 (
PID INTEGER,
PNAME VARCHAR(10))
AS
begin
update X1
set
NAME = :PNAME
where
http://X1.ID = :PID;
if (row_count = 0) then
insert into X1
values (
:PID,
:PNAME);
end^

SET TERM ; ^

====== Test Details ======

On 2.5.1 test for this ticket (made using python) leads FB to crash with following message in log:

 Access violation\.
	The code attempted to access a virtual
	address without privilege to do so\.
This exception will cause the Firebird server
to terminate abnormally\.

===
No problem on 2.5.7 and above.

@firebird-automations
Copy link
Collaborator Author

Modified by: acacio2000 (acacio2000)

Attachment: Bug.rar [ 12247 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE3924 [ CORE3924 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Duplicates CORE3924.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Done successfully

Test Details: On 2.5.1 test for this ticket (made using python) leads FB to crash with following message in log:

 Access violation\.
	The code attempted to access a virtual
	address without privilege to do so\.
This exception will cause the Firebird server
to terminate abnormally\.

===
No problem on 2.5.7 and above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant