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

43 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3367
ISSUE: 3367
TITLE: The new 2.5 feature to alter COMPUTED columns doesn't handle dependencies well
DESCRIPTION:
JIRA: CORE-2985
FBTEST: bugs.core_2985
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
init_script = """create table test (id numeric, f1 varchar(20));
2021-04-26 20:07:00 +02:00
create table test1(id1 numeric, ff computed((select f1 from test where id=id1)));
commit;
"""
2022-01-21 18:49:26 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """show table test1;
2021-04-26 20:07:00 +02:00
alter table test1 alter ff computed(cast(null as varchar(20)));
drop table test;
commit;
show table test1;
"""
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """ID1 NUMERIC(9, 0) Nullable
2021-04-26 20:07:00 +02:00
FF Computed by: ((select f1 from test where id=id1))
ID1 NUMERIC(9, 0) Nullable
FF Computed by: (cast(null as varchar(20)))
"""
2022-01-21 18:49:26 +01:00
@pytest.mark.version('>=3.0')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00