From 66ae194ee04a578a970cf0b3b4f5e2b628b0a398 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Wed, 1 Mar 2023 21:52:31 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7108_test.py: Checked on 4.0.3.2904, 5.0.0.964. --- tests/bugs/gh_7108_test.py | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/bugs/gh_7108_test.py diff --git a/tests/bugs/gh_7108_test.py b/tests/bugs/gh_7108_test.py new file mode 100644 index 00000000..578ad858 --- /dev/null +++ b/tests/bugs/gh_7108_test.py @@ -0,0 +1,48 @@ +#coding:utf-8 + +""" +ID: issue-7108 +ISSUE: https://github.com/FirebirdSQL/firebird/issues/7108 +TITLE: Firebird does not find an record when adding a foreign key +NOTES: + [01.03.2023] pzotov + Confirmed bug on 4.0.1.2701; fixed on 4.0.1.2711 + Checked on 4.0.3.2904, 5.0.0.964. +""" + +import pytest +from firebird.qa import * + +db = db_factory() + +test_script = """ + create table main (str varchar(1) character set utf8); + commit; + + insert into main(str) values ('X'); + commit; + + create table ref (id varchar(1) character set utf8 not null primary key); + commit; + + insert into ref(id) values ('1'); + commit; + + alter table main add ref_id varchar(1) character set utf8 default '1' not null; + commit; + + alter table main add constraint FK_MAIN foreign key (ref_id) references ref (id); +""" + +act = isql_act('db', test_script) + +"" + +expected_stdout = """ +""" + +@pytest.mark.version('>=4.0.2') +def test_1(act: Action): + act.expected_stdout = expected_stdout + act.execute(combine_output = True) + assert act.clean_stdout == act.clean_expected_stdout