mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\core_5337_test.py: Regression detected with 'UPDATE OR INSERT' statement (it was missed in original version of this test), added appropriate EXECUTE BLOCK.
This commit is contained in:
parent
c9a2075b04
commit
7093239465
@ -3,11 +3,15 @@
|
||||
"""
|
||||
ID: issue-5613
|
||||
ISSUE: 5613
|
||||
TITLE: Regression: The subquery in the insert list expressions ignore the changes
|
||||
made earlier in the same executable block.
|
||||
TITLE: Regression: The subquery in the insert list expressions ignore the changes made earlier in the same executable block.
|
||||
DESCRIPTION:
|
||||
JIRA: CORE-5337
|
||||
FBTEST: bugs.core_5337
|
||||
NOTES:
|
||||
[27.06.2023] pzotov
|
||||
Regression detected with 'UPDATE OR INSERT' statement (it was missed in original version of this test), added appropriate EXECUTE BLOCK.
|
||||
Checked on 5.0.0.1088 (intermediate build after https://github.com/FirebirdSQL/firebird/commit/421a73ae4bd28dd935d1f668f43f9cc89bcf7fdd )
|
||||
Thanks to dimitr.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
@ -16,34 +20,54 @@ from firebird.qa import *
|
||||
db = db_factory()
|
||||
|
||||
test_script = """
|
||||
set list on;
|
||||
recreate table test (
|
||||
id integer not null,
|
||||
val integer not null
|
||||
id int primary key using index test_id
|
||||
,val int not null
|
||||
);
|
||||
|
||||
set term ^;
|
||||
execute block
|
||||
as
|
||||
execute block as
|
||||
begin
|
||||
insert into test (id, val) values (1, 100);
|
||||
insert into test (id, val) values (2, (select val from test where id = 1));
|
||||
insert into test (id, val) values (1, 111);
|
||||
insert into test (id, val) values (2, 2 * (select val from test where id = 1));
|
||||
end
|
||||
^
|
||||
set term ;^
|
||||
|
||||
set list on;
|
||||
select * from test;
|
||||
rollback;
|
||||
select * from test ^
|
||||
rollback ^
|
||||
---------------------
|
||||
execute block as
|
||||
begin
|
||||
insert into test (id, val) values (3, 333);
|
||||
end
|
||||
^
|
||||
execute block as
|
||||
begin
|
||||
update or insert into test( id
|
||||
,val
|
||||
)
|
||||
values( 4
|
||||
,3 * (select val from test where id = 3)
|
||||
)
|
||||
matching(id);
|
||||
end
|
||||
^
|
||||
select * from test ^
|
||||
rollback ^
|
||||
"""
|
||||
|
||||
act = isql_act('db', test_script)
|
||||
|
||||
expected_stdout = """
|
||||
ID 1
|
||||
VAL 100
|
||||
|
||||
VAL 111
|
||||
ID 2
|
||||
VAL 100
|
||||
VAL 222
|
||||
|
||||
ID 3
|
||||
VAL 333
|
||||
ID 4
|
||||
VAL 999
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0.1')
|
||||
|
Loading…
Reference in New Issue
Block a user