2021-04-26 20:07:00 +02:00
|
|
|
|
#coding:utf-8
|
|
|
|
|
#
|
|
|
|
|
# id: bugs.core_2804
|
|
|
|
|
# title: Problems with COMMENT ON and strings using introducer (charset)
|
|
|
|
|
# decription:
|
|
|
|
|
# tracker_id: CORE-2804
|
|
|
|
|
# min_versions: ['2.5.4']
|
|
|
|
|
# versions: 2.5.4
|
|
|
|
|
# qmid: bugs.core_2804
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
from firebird.qa import db_factory, isql_act, Action
|
|
|
|
|
|
|
|
|
|
# version: 2.5.4
|
|
|
|
|
# resources: None
|
|
|
|
|
|
|
|
|
|
substitutions_1 = [('DESCR_BLOB_ID.*', '')]
|
|
|
|
|
|
|
|
|
|
init_script_1 = """"""
|
|
|
|
|
|
|
|
|
|
db_1 = db_factory(from_backup='core2804-ods11.fbk', init=init_script_1)
|
|
|
|
|
|
|
|
|
|
test_script_1 = """
|
|
|
|
|
-- Database was prepared with following statements:
|
|
|
|
|
-- recreate table test1(id int);
|
|
|
|
|
-- recreate table test2(id int);
|
|
|
|
|
-- commit;
|
|
|
|
|
-- comment on table test1 is _win1251 'win1251: <cyrillic text here encoded with win1251>';
|
|
|
|
|
-- comment on table test2 is _unicode_fss 'unicode_fss: <cyrillic text here encoded with UTF8>';
|
|
|
|
|
-- commit;
|
|
|
|
|
|
|
|
|
|
set blob all;
|
|
|
|
|
set list on;
|
|
|
|
|
select r.rdb$description as descr_blob_id
|
|
|
|
|
from rdb$relations r where r.rdb$relation_name in ( upper('test1'), upper('test2') )
|
|
|
|
|
order by r.rdb$relation_name;
|
2021-12-22 20:23:11 +01:00
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|
|
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
|
|
|
|
|
|
|
|
|
expected_stdout_1 = """
|
|
|
|
|
DESCR_BLOB_ID 0:3
|
|
|
|
|
win1251: Протокол собрания об уплотнении квартир дома
|
|
|
|
|
|
|
|
|
|
DESCR_BLOB_ID 0:6
|
|
|
|
|
unicode_fss: Протокол собрания о помощи детям Германии
|
2021-12-22 20:23:11 +01:00
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|
|
@pytest.mark.version('>=2.5.4')
|
2021-04-28 12:42:11 +02:00
|
|
|
|
def test_1(act_1: Action):
|
2021-04-26 20:07:00 +02:00
|
|
|
|
act_1.expected_stdout = expected_stdout_1
|
|
|
|
|
act_1.execute()
|
2021-12-22 20:23:11 +01:00
|
|
|
|
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|