6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_6532_test.py

92 lines
2.3 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-6759
ISSUE: 6759
TITLE: Results of concatenation with blob has no info about collation of source
columns (which are declared with such info)
2022-01-27 20:08:36 +01:00
DESCRIPTION:
JIRA: CORE-6532
FBTEST: bugs.core_6532
2022-01-27 20:08:36 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
create collation name_coll for utf8 from unicode case insensitive;
commit;
--create domain dm_name_ci as varchar(10) character set utf8 collate name_coll;
create domain dm_name_ci as blob sub_type text character set utf8 collate name_coll;
commit;
recreate table test(
id int
,c1 varchar(10) character set utf8 collate name_coll
,b1 dm_name_ci
--,b1 blob sub_type text character set utf8 collate name_coll -- same result
);
insert into test(id, c1, b1) values(1,'qWE','qWE');
insert into test(id, c1, b1) values(2,'QWe','QWe');
insert into test(id, c1, b1) values(3,'qwE','qwE');
commit;
set count on;
-- set echo on;
set list on;
---------------------------------------------
select id from test
where
b1 starting with 'qwe' -- Records affected: 3 // OK
order by id
;
---------------------------------------------
select id from test
where
b1 || b1 starting with 'qwe' -- Was wrong: "Records affected: 0"
order by id
;
--------------------------------------------
select id from test
where
c1 || cast(c1 as blob sub_type text character set utf8) collate name_coll starting with 'qwe' -- Was wrong: "Records affected: 0"
order by id
2022-01-27 20:08:36 +01:00
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
ID 1
ID 2
ID 3
Records affected: 3
ID 1
ID 2
ID 3
Records affected: 3
ID 1
ID 2
ID 3
Records affected: 3
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0.8')
2022-01-27 20:08:36 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout