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

37 lines
878 B
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-4395
ISSUE: 4395
TITLE: Problem with "CREATE DATABASE ... COLLATION ..." and 1 dialect
DESCRIPTION:
JIRA: CORE-4067
FBTEST: bugs.core_4067
2022-01-23 20:41:55 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2021-11-18 20:15:37 +01:00
from pathlib import Path
2022-01-23 20:41:55 +01:00
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
db = db_factory()
2021-11-18 20:15:37 +01:00
2022-01-23 20:41:55 +01:00
act = python_act('db')
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
X 1
2021-11-18 20:15:37 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
temp_db = temp_file('tmp_4067_1.fdb')
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action, temp_db: Path):
2021-11-18 20:15:37 +01:00
test_script = f"""
set sql dialect 1;
2022-01-23 20:41:55 +01:00
create database 'localhost:{str(temp_db)}' page_size 4096 default character set win1251 collation win1251;
2021-11-18 20:15:37 +01:00
set list on;
select mon$sql_dialect as x from mon$database;
2021-12-22 20:23:11 +01:00
"""
2022-01-23 20:41:55 +01:00
act.expected_stdout = expected_stdout
act.isql(switches=[], input=test_script, connect_db=False)
assert act.clean_stdout == act.clean_expected_stdout