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

100 lines
2.2 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-3160
ISSUE: 3160
TITLE: ALTERING OR DROPPING PROCEDURE which has type of domain parameter leads to attempt to delete that domain
DESCRIPTION:
JIRA: CORE-2768
FBTEST: bugs.core_2768
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
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
recreate view v_fields as
select rf.rdb$field_name f_name, rf.rdb$field_length f_length, rf.rdb$field_type f_type
from rdb$database r
left join rdb$fields rf on rf.rdb$field_name = upper('dm_test')
;
recreate view v_dependencies as
select rd.rdb$dependent_name as dep_obj_name, rd.rdb$depended_on_name as dep_on_what
from rdb$database r
left join rdb$dependencies rd on rd.rdb$dependent_name = upper('sp_test')
;
create or alter procedure sp_test as begin end
;
set term ^;
execute block as
begin
begin
execute statement 'drop domain dm_test';
when any do begin end
end
end
^
set term ;^
commit;
create domain dm_test int;
commit;
create or alter procedure sp_test( a_01 type of dm_test ) as begin end;
commit;
set count on;
set list on;
select * from v_fields ;
select * from v_dependencies ;
commit;
alter procedure sp_test as begin end;
2022-01-21 18:49:26 +01:00
commit; -- here was error in 2.5 Beta 2, 2.5 RC1
2021-04-26 20:07:00 +02:00
select * from v_fields ;
select * from v_dependencies ;
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
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 = """
2021-04-26 20:07:00 +02:00
F_NAME DM_TEST
F_LENGTH 4
F_TYPE 8
Records affected: 1
DEP_OBJ_NAME SP_TEST
DEP_ON_WHAT DM_TEST
Records affected: 1
F_NAME DM_TEST
F_LENGTH 4
F_TYPE 8
Records affected: 1
DEP_OBJ_NAME <null>
DEP_ON_WHAT <null>
Records affected: 1
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
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