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

52 lines
1.1 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-23 20:41:55 +01:00
"""
ID: issue-4792
ISSUE: 4792
TITLE: Message "Modifying function <F> which is currently in use" when running script with AUTODDL=OFF and <F> is called from INTERNAL function declared in other unit
DESCRIPTION:
JIRA: CORE-4472
FBTEST: bugs.core_4472
2022-01-23 20:41:55 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2021-11-26 19:20:43 +01:00
from difflib import unified_diff
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-04-26 20:07:00 +02: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
test_script = """
2021-11-26 19:20:43 +01:00
set autoddl off;
commit;
set term ^;
create or alter function fn_01() returns int
as begin
return 1;
end
^
2021-04-26 20:07:00 +02:00
2021-11-26 19:20:43 +01:00
create or alter procedure sp_01
as
declare function fn_internal_01 returns int as
begin
if ( fn_01() > 0 ) then return 1;
else return 0;
end
begin
end
^
set term ;^
commit;
2021-12-22 20:23:11 +01:00
"""
2022-01-23 20:41:55 +01:00
@pytest.mark.version('>=3.0')
def test_1(act: Action):
log_before = act.get_firebird_log()
act.expected_stdout = ''
act.isql(switches=['-q', '-m'], input=test_script)
log_after = act.get_firebird_log()
assert act.clean_stdout == act.clean_expected_stdout
2021-11-26 19:20:43 +01:00
assert list(unified_diff(log_before, log_after)) == []