6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\core_3675_test.py: Removed SHOW command for check result because its output often changes.

This commit is contained in:
pavel-zotov 2023-10-05 15:23:43 +03:00
parent eff0d49c92
commit 15e33b7a64

View File

@ -7,38 +7,96 @@ TITLE: CREATE INDEX considers NULL and empty string being the same in comp
DESCRIPTION: DESCRIPTION:
JIRA: CORE-3675 JIRA: CORE-3675
FBTEST: bugs.core_3675 FBTEST: bugs.core_3675
[05.10.2023] pzotov
Removed SHOW command for check result because its output often changes.
""" """
import pytest import pytest
from firebird.qa import * from firebird.qa import *
db = db_factory(from_backup='core3675.fbk') db = db_factory()
test_script = """ test_script = """
show table t; set bail on;
select * from t; 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) act = isql_act('db', test_script)
expected_stdout = """ expected_stdout = """
F1 VARCHAR(1) Nullable ID 1
F2 VARCHAR(1) Nullable F1 a
F3 VARCHAR(1) Nullable F2 b
F4 VARCHAR(1) Nullable F3 c
CONSTRAINT T1_UNQ: F4 d
Unique key (F1, F2, F3, F4)
F1 F2 F3 F4 ID 2
====== ====== ====== ====== F1 a
a b c d F2 <null>
a <null> c d F3 c
a c d F4 d
a b <null> d
a b <null> ID 3
a b <null> F1 a
a b <null> <null> F2
a <null> <null> <null> F3 c
<null> <null> <null> <null> F4 d
ID 4
F1 a
F2 b
F3 <null>
F4 d
ID 5
F1 a
F2 b
F3 <null>
F4
ID 6
F1 a
F2 b
F3
F4 <null>
ID 7
F1 a
F2 b
F3 <null>
F4 <null>
ID 8
F1 a
F2 <null>
F3 <null>
F4 <null>
ID 9
F1 <null>
F2 <null>
F3 <null>
F4 <null>
""" """
@pytest.mark.version('>=3') @pytest.mark.version('>=3')