6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/bugs/core_5304_test.py

41 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-25 22:55:48 +01:00
"""
ID: issue-5581
ISSUE: 5581
TITLE: Regression: Can not restore database with table contains field CHAR(n) and UTF8 character set
DESCRIPTION:
We make initial DDL and DML using ISQL with connection charset = UTF8, and then run b/r.
Ouput of restore is filtered so that only lines with 'ERROR' word can be displayed.
This output should be EMPTY (i.e. no errors should occur).
JIRA: CORE-5304
"""
2021-04-26 20:07:00 +02:00
import pytest
2021-12-06 19:23:35 +01:00
from pathlib import Path
2022-01-25 22:55:48 +01:00
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
init_script = """
2021-12-06 19:23:35 +01:00
recreate table test(c char(10));
commit;
insert into test values(null);
commit;
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
db = db_factory(charset='UTF8', init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
act = python_act('db')
2021-12-06 19:23:35 +01:00
fbk_file = temp_file('tmp_core_5304.fbk')
fdb_file = temp_file('tmp_core_5304.fdb')
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=4.0')
2022-01-25 22:55:48 +01:00
def test_1(act: Action, fbk_file: Path, fdb_file: Path):
with act.connect_server() as srv:
srv.database.backup(database=act.db.db_path, backup=fbk_file)
2021-12-06 19:23:35 +01:00
srv.wait()
srv.database.restore(backup=fbk_file, database=fdb_file)
2021-12-06 19:23:35 +01:00
srv.wait()
2021-04-26 20:07:00 +02:00