2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
|
|
|
ID: issue-4025
|
|
|
|
ISSUE: 4025
|
|
|
|
TITLE: CREATE INDEX considers NULL and empty string being the same in compound indices
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3675
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3675
|
2023-10-05 14:32:38 +02:00
|
|
|
NOTES:
|
2023-10-05 14:23:43 +02:00
|
|
|
[05.10.2023] pzotov
|
|
|
|
Removed SHOW command for check result because its output often changes.
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2023-10-05 14:23:43 +02:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
test_script = """
|
2023-10-05 14:23:43 +02:00
|
|
|
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;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
expected_stdout = """
|
2023-10-05 14:23:43 +02:00
|
|
|
ID 1
|
|
|
|
F1 a
|
|
|
|
F2 b
|
|
|
|
F3 c
|
|
|
|
F4 d
|
|
|
|
|
|
|
|
ID 2
|
|
|
|
F1 a
|
|
|
|
F2 <null>
|
|
|
|
F3 c
|
|
|
|
F4 d
|
|
|
|
|
|
|
|
ID 3
|
|
|
|
F1 a
|
|
|
|
F2
|
|
|
|
F3 c
|
|
|
|
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>
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|