From 15e33b7a64dd771c7db1d290a4f8fad4f7535a73 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Thu, 5 Oct 2023 15:23:43 +0300 Subject: [PATCH] Added/Updated tests\bugs\core_3675_test.py: Removed SHOW command for check result because its output often changes. --- tests/bugs/core_3675_test.py | 98 ++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 20 deletions(-) diff --git a/tests/bugs/core_3675_test.py b/tests/bugs/core_3675_test.py index b1169f4a..d87bbf74 100644 --- a/tests/bugs/core_3675_test.py +++ b/tests/bugs/core_3675_test.py @@ -7,38 +7,96 @@ TITLE: CREATE INDEX considers NULL and empty string being the same in comp DESCRIPTION: JIRA: CORE-3675 FBTEST: bugs.core_3675 + [05.10.2023] pzotov + Removed SHOW command for check result because its output often changes. """ import pytest from firebird.qa import * -db = db_factory(from_backup='core3675.fbk') +db = db_factory() test_script = """ - show table t; - select * from t; + set bail on; + set list on; + recreate table test( + f1 varchar(1) + ,f2 varchar(1) + ,f3 varchar(1) + ,f4 varchar(1) + ,id int primary key + ,constraint test_unq unique(f1,f2,f3,f4) + ); + commit; + insert into test values('a', 'b', 'c', 'd', 1); + insert into test values('a', null, 'c', 'd', 2); + insert into test values('a', '', 'c', 'd', 3); + insert into test values('a', 'b', null, 'd', 4); + insert into test values('a', 'b', null, '', 5); + insert into test values('a', 'b', '', null, 6); + insert into test values('a', 'b', null, null, 7); + insert into test values('a', null, null, null, 8); + insert into test values(null, null, null, null, 9); + commit; + select id,f1,f2,f3,f4 from test order by id; """ act = isql_act('db', test_script) expected_stdout = """ -F1 VARCHAR(1) Nullable -F2 VARCHAR(1) Nullable -F3 VARCHAR(1) Nullable -F4 VARCHAR(1) Nullable -CONSTRAINT T1_UNQ: - Unique key (F1, F2, F3, F4) -F1 F2 F3 F4 -====== ====== ====== ====== -a b c d -a c d -a c d -a b d -a b -a b -a b -a - + ID 1 + F1 a + F2 b + F3 c + F4 d + + ID 2 + F1 a + F2 + F3 c + F4 d + + ID 3 + F1 a + F2 + F3 c + F4 d + + ID 4 + F1 a + F2 b + F3 + F4 d + + ID 5 + F1 a + F2 b + F3 + F4 + + ID 6 + F1 a + F2 b + F3 + F4 + + ID 7 + F1 a + F2 b + F3 + F4 + + ID 8 + F1 a + F2 + F3 + F4 + + ID 9 + F1 + F2 + F3 + F4 """ @pytest.mark.version('>=3')