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

38 lines
964 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-26 21:10:46 +01:00
"""
ID: issue-6290
ISSUE: 6290
TITLE: Metadata script extracted using ISQL is invalid/incorrect when table has COMPUTED BY field
DESCRIPTION:
'collate' clause must present in DDL of computed_by field, otherwise extracted metadata script will be correct.
JIRA: CORE-6040
FBTEST: bugs.core_6040
2022-01-26 21:10:46 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
init_script = """
2021-12-10 19:50:31 +01:00
recreate table users (
f01 varchar(32) character set win1252 not null collate win_ptbr
,f02 computed by ( f01 collate win_ptbr )
);
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
db = db_factory(init=init_script, charset='win1252')
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2021-12-10 19:50:31 +01:00
@pytest.mark.version('>=3.0.5')
2022-01-26 21:10:46 +01:00
def test_1(act: Action):
act.isql(switches=['-x'], charset='win1252')
meta = act.stdout
2021-12-10 19:50:31 +01:00
#
2022-01-26 21:10:46 +01:00
with act.db.connect() as con:
2021-12-10 19:50:31 +01:00
con.execute_immediate('drop table users')
con.commit()
#
2022-01-26 21:10:46 +01:00
act.reset()
act.isql(switches=[], charset='win1252', input=meta)