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_6324_test.py

86 lines
2.5 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-6565
ISSUE: 6565
TITLE: Alter domain operation for domain with collation specified revert its collation to database default
DESCRIPTION:
NB: current behaviour contradicts ticket notes!
FB *must* change collation of altered domain, see issue by dimitr in the ticket 06/Jun/20 08:04 AM:
"character set is not a part of the domain itself, it's a part of its data type".
JIRA: CORE-6324
FBTEST: bugs.core_6324
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(charset='UTF8')
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
set width fld_name 20;
set width cset_name 20;
set width coll_name 20;
set list on;
recreate view v_test as
select
f.rdb$field_name fld_name
--,f.rdb$character_set_id cset_id
--,f.rdb$collation_id coll_id
,c.rdb$character_set_name cset_name
,s.rdb$collation_name coll_name
from rdb$fields f
left join rdb$character_sets c on f.rdb$character_set_id = c.rdb$character_set_id
left join rdb$collations s on
f.rdb$collation_id = s.rdb$collation_id
and c.rdb$character_set_id = s.rdb$character_set_id
where f.rdb$field_name = upper('dm_test');
create domain dm_test varchar(1000) character set win1250 collate pxw_plk;
commit;
select 'POINT-1' msg, v.* from v_test v;
commit;
-- Required result: collation must change from PXW_PLK to WIN1250.
alter domain dm_test type varchar(1000) character set win1250;
commit;
select 'POINT-2' msg, v.* from v_test v;
commit;
-- Required result: collation must be REMOVED:
alter domain dm_test type varchar(1000);
commit;
select 'POINT-3' msg, v.* from v_test v;
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, substitutions=[('[ \t]+', ' ')])
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
MSG POINT-1
FLD_NAME DM_TEST
CSET_NAME WIN1250
COLL_NAME PXW_PLK
MSG POINT-2
FLD_NAME DM_TEST
CSET_NAME WIN1250
COLL_NAME WIN1250
MSG POINT-3
FLD_NAME DM_TEST
CSET_NAME UTF8
COLL_NAME UTF8
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.5.9')
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