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

67 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3016
ISSUE: 3016
TITLE: Multibyte CHAR value requested as VARCHAR is returned with padded spaces
DESCRIPTION:
JIRA: CORE-2606
FBTEST: bugs.core_2606
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
act = python_act('db')
2021-11-16 19:44:53 +01:00
2022-01-21 18:49:26 +01:00
test_script = """
2021-11-16 19:44:53 +01:00
set list on;
select s.rdb$character_set_name as client_charset
from mon$attachments a
join rdb$character_sets s on a.mon$character_set_id = s.rdb$character_set_id
where a.mon$attachment_id=current_connection;
--set sqlda_display on;
--set planonly;
--set echo on;
select cast('A' as char character set utf8) || '.' as char1_utf8 from rdb$database;
select cast('A' as varchar(1) character set utf8) || '.' as varc1_utf8 from rdb$database;
select cast('A' as char character set ascii) || '.' char1_ascii from rdb$database;
select cast('A' as varchar(1) character set ascii) || '.' varc1_ascii from rdb$database;
"""
2022-01-21 18:49:26 +01:00
expected_stdout_a = """
2021-04-26 20:07:00 +02:00
CLIENT_CHARSET UTF8
CHAR1_UTF8 A.
VARC1_UTF8 A.
CHAR1_ASCII A.
VARC1_ASCII A.
2021-11-16 19:44:53 +01:00
"""
2022-01-21 18:49:26 +01:00
expected_stdout_b = """
2021-04-26 20:07:00 +02:00
CLIENT_CHARSET SJIS_0208
CHAR1_UTF8 A.
VARC1_UTF8 A.
CHAR1_ASCII A.
VARC1_ASCII A.
2021-11-16 19:44:53 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.intl
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-21 18:49:26 +01:00
def test_1(act: Action):
act.script = test_script
act.expected_stdout = expected_stdout_a
act.execute(charset='UTF8')
assert act.clean_stdout == act.clean_expected_stdout
act.reset()
act.expected_stdout = expected_stdout_b
act.execute(charset='SJIS_0208')
assert act.clean_stdout == act.clean_expected_stdout
2021-11-16 19:44:53 +01:00
2021-04-26 20:07:00 +02:00