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

73 lines
1.8 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-3432
ISSUE: 3432
TITLE: Wrong resultset
DESCRIPTION:
Empty rowset when selecting from table with compound index on PXW_HUNDC-collated fields
JIRA: CORE-3052
FBTEST: bugs.core_3052
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
2022-01-22 21:59:15 +01:00
db = db_factory(charset='WIN1250')
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
-- NB: do NOT downgrate minimal version to 2.5 - at least for 2.5.4.26857
-- following queries return zero rows.
create domain xvar10n as varchar(160) character set WIN1250 not null collate PXW_HUNDC;
create domain xint as int;
commit;
create table tmp_test (
m1 xvar10n
,m2 xvar10n
,val xint
);
commit;
alter table tmp_test add constraint tmp_test_uk1 unique (m1, m2);
commit;
insert into tmp_test (m1, m2, val) values ('A', 'C1', 1);
insert into tmp_test (m1, m2, val) values ('A', 'C2', 2);
insert into tmp_test (m1, m2, val) values ('A', 'D2', 3);
insert into tmp_test (m1, m2, val) values ('A', 'M3', 3);
set list on;
select *
from tmp_test te
where te.m1 = 'A' and te.m2 like 'C%';
select *
from tmp_test te
where te.m1 = 'A' and te.m2 like 'D%';
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 = """
2021-04-26 20:07:00 +02:00
M1 A
M2 C1
VAL 1
M1 A
M2 C2
VAL 2
M1 A
M2 D2
VAL 3
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-22 21:59:15 +01:00
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