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

76 lines
2.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-23 20:41:55 +01:00
"""
ID: issue-1551
ISSUE: 1551
TITLE: User-collations based on UNICODE are not upgrade to newer ICU version on restore
DESCRIPTION:
Test uses .fbk which was created on linux host and has collation with following DDL:
create collation nums_coll for utf8 from unicode case insensitive 'NUMERIC-SORT=1';
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
SHOW COLLATION on linux host did show: COLL-VERSION=49.192.5.41.
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
We restore this database and try to use existing collation again.
JIRA: CORE-4425
FBTEST: bugs.core_4425
2022-01-23 20:41:55 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
db = db_factory(from_backup='core4425.fbk')
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
create domain dm_nums2 as varchar(20) character set utf8 collate nums_coll;
commit;
create table test2(s1 dm_nums2, s2 dm_nums2);
commit;
insert into test2 values('123qWe', '123QwE');
insert into test2 values('1zXcvU', '1ZXcvu');
insert into test2 values('12XcvU', '12xCVu');
commit;
2022-01-23 20:41:55 +01:00
set list on;
2021-04-26 20:07:00 +02:00
select 'old table:' as msg, s1,s2,s1=s2 from test order by s1;
select 'new table:' as msg, s1,s2,s1=s2 from test2 order by s2;
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
MSG old table:
S1 1zXcvU
S2 1ZXcvu
<true>
MSG old table:
S1 12XcvU
S2 12xCVu
<true>
MSG old table:
S1 123qWe
S2 123QwE
<true>
MSG new table:
S1 1zXcvU
S2 1ZXcvu
<true>
MSG new table:
S1 12XcvU
S2 12xCVu
<true>
MSG new table:
S1 123qWe
S2 123QwE
<true>
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-23 20:41:55 +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