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

Server crashes with access violation when inserting row into table with unique index [CORE3627] #3979

Closed
firebird-issue-importer opened this issue Oct 11, 2011 · 7 comments

Comments

@firebird-issue-importer

Submitted by: Marcin Wojda (mrcwda)

Jira_subtask_outward CORE3631
Is related to QA491

To reproduce run the following two scripts with isql.exe (each script sould be executed separately):

1. Create database with table and two rows with the script:

CREATE DATABASE 'test.fdb' USER 'sysdba' PASSWORD 'masterkey';
CREATE TABLE TestTable
(
"ID" INTEGER NOT NULL,
"CLASSID" INTEGER,
PRIMARY KEY ("ID")
);
insert into TestTable values(1, 1);
insert into TestTable values(2, 2);

2. Add index and try to insert a record with second script:

ALTER TABLE TestTable ADD KsgFK integer;
CREATE UNIQUE INDEX ClassIdKsgIdx ON TestTable (ClassId, KsgFK);
insert into TestTable values(3,1,Null);

The server will crash with message:

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.

Updating the table "TestTable" with query: update TestTable set Id = Id; before inserting the third row solves the problem - the statment fails with message "attemp to store duplicate value".

Commits: 2390d0b 490471d

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

Confirmed crash on WI-V2.5.1.26351:
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "localhost".
-Error reading data from the connection.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 12, 2011

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 12, 2011

Commented by: @AlexPeshkoff

Trunk does not segfault in this test, but I anyway front-ported solution from 2.5, cause that const_cast was really awful. Segfault happened due to an attempt to write into literal string.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 12, 2011

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.5.2 [ 10450 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 27, 2014

Modified by: @pcisar

Link: This issue is related to QA491 [ QA491 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: Confirmed crash on WI-V2.5.1.26351:
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "localhost".
-Error reading data from the connection.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 25, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 25, 2015

Modified by: @pcisar

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

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

Successfully merging a pull request may close this issue.

None yet
2 participants