6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_4067_test.py

39 lines
1011 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()
act = python_act('db', substitutions = [('[ \t]+', ' ')])
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
expected_stdout = """
SQL_DIALECT 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 bail on;
set list on;
set sql dialect 1;
create database 'localhost:{str(temp_db)}' page_size 4096 default character set win1251 collation win1251;
select mon$sql_dialect as sql_dialect from mon$database;
commit;
drop database;
"""
2022-01-23 20:41:55 +01:00
act.expected_stdout = expected_stdout
act.isql(switches = ['-q'], input=test_script, connect_db=False, combine_output = True)
2022-01-23 20:41:55 +01:00
assert act.clean_stdout == act.clean_expected_stdout