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
SELECT WITH LOCK with no fields are accessed clears the data [CORE2633] #3041
Comments
Commented by: Sean Leyne (seanleyne) Edited the case summary/title to provide clearer details for possible readers |
Modified by: Sean Leyne (seanleyne)summary: SELECT WITH LOCK corrupts data => SELECT WITH LOCK within EXECUTE BLOCK corrupts data |
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Commented by: @hvlad The bug is related to the feature CORE1598 (Optimize data retrieval for tables when no fields are accessed). I see two ways to fix it : I think (a) is better and will commit it. |
Commented by: @hvlad More exact description |
Modified by: @hvladVersion: 2.5 Beta 2 [ 10300 ] Version: 2.5 Alpha 1 [ 10224 ] summary: SELECT WITH LOCK within EXECUTE BLOCK corrupts data => SELECT WITH LOCK with no fields are accessed clears the data |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5 RC1 [ 10362 ] |
Modified by: @pmakowskistatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: prenosil (prenosil)
Is related to QA416
"SELECT ... WITH LOCK" inside Execute Block corrupts data, even subsequent ROLLBACK does not help.
In the following script, the first select will show
SELECT * FROM T;
A B
==================== ===========
aaaa 1
bbbb 2
cccc 3
while the subsequent selects (before and after Rollback) will show
SELECT * FROM T;
A B
==================== ===========
0
0
0
--------------------
CREATE DATABASE 'C:\TESTDB.FDB';
CREATE TABLE T (A VARCHAR(20), B INTEGER);
INSERT INTO T(A,B) VALUES('aaaa',1);
INSERT INTO T(A,B) VALUES('bbbb',2);
INSERT INTO T(A,B) VALUES('cccc',3);
COMMIT;
SELECT * FROM T;
SET TERM ^;
EXECUTE BLOCK AS
DECLARE I INTEGER;
BEGIN
FOR SELECT 1 FROM T WITH LOCK INTO :I DO I=I;
END^
SET TERM ;^
SELECT * FROM T;
ROLLBACK;
SELECT * FROM T;
DROP DATABASE;
--------------------
Commits: 89d72e5
The text was updated successfully, but these errors were encountered: