
If you were logged in you would be able to see more operations.
|
|
|
Issue Links:
|
Relate
|
This issue relate to:
|
|
CORE-3362
Cursors should ignore changes made by the same statement
|
|
|
|
|
|
|
|
QA Status: |
Done successfully
|
Test Details: |
Checked on:
WI-T3.0.0.31374 Firebird 3.0 Beta 1
WI-V3.0.0.32300 Firebird 3.0 Release Candidate 2
-- works OK.
Checked on:
WI-T3.0.0.31374 Firebird 3.0 Beta 1
WI-V3.0.0.32300 Firebird 3.0 Release Candidate 2
-- works OK.
|
CREATE TABLE TEST
(
ID INTEGER NOT NULL PRIMARY KEY,
KOD VARCHAR(5)
);
COMMIT;
INSERT INTO TEST(ID, KOD) VALUES(1, 'abc');
INSERT INTO TEST(ID, KOD) VALUES(2, 'abc');
COMMIT;
now we have 2 rows in table
and delete in ascending oreder
DELETE FROM TEST T WHERE EXISTS(SELECT * FROM TEST T2 WHERE T2.ID<>T.ID AND T2.KOD=T.KOD) ORDER BY T.ID ASC
COMMIT;
one row affected ..
SELECT * FROM TEST;
one row selected ID=2 KOD='abc'
clear table
DELETE FROM TEST;
COMMIT;
once again insert the same records
INSERT INTO TEST(ID, KOD) VALUES(1, 'abc');
INSERT INTO TEST(ID, KOD) VALUES(2, 'abc');
COMMIT;
now we have 2 rows in table
and delete in descending oreder
DELETE FROM TEST T WHERE EXISTS(SELECT * FROM TEST T2 WHERE T2.ID<>T.ID AND T2.KOD=T.KOD) ORDER BY T.ID DESC
COMMIT;
two rows affected!
SELECT * FROM TEST;
empty result set!
you see that deleting with asc and desc do big difference but here should not
with asc sorting you delete 1 record which is ok
and with desc sorting you delete2 records(all) which is wrong
|
Description
|
CREATE TABLE TEST
(
ID INTEGER NOT NULL PRIMARY KEY,
KOD VARCHAR(5)
);
COMMIT;
INSERT INTO TEST(ID, KOD) VALUES(1, 'abc');
INSERT INTO TEST(ID, KOD) VALUES(2, 'abc');
COMMIT;
now we have 2 rows in table
and delete in ascending oreder
DELETE FROM TEST T WHERE EXISTS(SELECT * FROM TEST T2 WHERE T2.ID<>T.ID AND T2.KOD=T.KOD) ORDER BY T.ID ASC
COMMIT;
one row affected ..
SELECT * FROM TEST;
one row selected ID=2 KOD='abc'
clear table
DELETE FROM TEST;
COMMIT;
once again insert the same records
INSERT INTO TEST(ID, KOD) VALUES(1, 'abc');
INSERT INTO TEST(ID, KOD) VALUES(2, 'abc');
COMMIT;
now we have 2 rows in table
and delete in descending oreder
DELETE FROM TEST T WHERE EXISTS(SELECT * FROM TEST T2 WHERE T2.ID<>T.ID AND T2.KOD=T.KOD) ORDER BY T.ID DESC
COMMIT;
two rows affected!
SELECT * FROM TEST;
empty result set!
you see that deleting with asc and desc do big difference but here should not
with asc sorting you delete 1 record which is ok
and with desc sorting you delete2 records(all) which is wrong
|
Show » |
|