mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-23 05:53:06 +01:00
85 lines
1.8 KiB
Python
85 lines
1.8 KiB
Python
|
#coding:utf-8
|
||
|
|
||
|
"""
|
||
|
ID: issue-7456
|
||
|
ISSUE: 7456
|
||
|
TITLE: Impossible drop function in package with name of PSQL-function
|
||
|
NOTES:
|
||
|
[15.02.2023] pzotov
|
||
|
Confirmed bug on 5.0.0.917
|
||
|
Checked on 5.0.0.920, 4.0.3.2900, 3.0.11.33664 -- all fine.
|
||
|
"""
|
||
|
|
||
|
import pytest
|
||
|
from firebird.qa import *
|
||
|
|
||
|
db = db_factory()
|
||
|
|
||
|
test_script = """
|
||
|
set bail on;
|
||
|
set list on;
|
||
|
set term ^;
|
||
|
create or alter function func1 returns int as
|
||
|
begin
|
||
|
return 1;
|
||
|
end
|
||
|
^
|
||
|
|
||
|
create or alter package test_pkg as
|
||
|
begin
|
||
|
-- same name of real function, but in package:
|
||
|
function func1() returns int;
|
||
|
function func2() returns int;
|
||
|
end
|
||
|
^
|
||
|
|
||
|
recreate package body test_pkg as
|
||
|
begin
|
||
|
function func1() returns int as
|
||
|
begin
|
||
|
return 11;
|
||
|
end
|
||
|
|
||
|
function func2() returns int as
|
||
|
begin
|
||
|
return 12;
|
||
|
end
|
||
|
end
|
||
|
^
|
||
|
|
||
|
create or alter procedure test_proc as
|
||
|
declare new_int int;
|
||
|
begin
|
||
|
new_int = func1();
|
||
|
rdb$set_context('USER_SESSION','STANDALONE_PROC_DONE',1);
|
||
|
end
|
||
|
^
|
||
|
|
||
|
-- used psql-function, function in package no need, drop it:
|
||
|
create or alter package test_pkg as
|
||
|
begin
|
||
|
function func2() returns int;
|
||
|
end
|
||
|
^
|
||
|
set term ^;
|
||
|
|
||
|
execute procedure test_proc;
|
||
|
select rdb$get_context('USER_SESSION','STANDALONE_PROC_DONE') as STANDALONE_PROC_DONE from rdb$database;
|
||
|
"""
|
||
|
|
||
|
act = isql_act('db', test_script)
|
||
|
|
||
|
expected_stdout = """
|
||
|
STANDALONE_PROC_DONE 1
|
||
|
"""
|
||
|
|
||
|
expected_stderr = """
|
||
|
"""
|
||
|
|
||
|
@pytest.mark.version('>=3.0')
|
||
|
def test_1(act: Action):
|
||
|
act.expected_stdout = expected_stdout
|
||
|
act.expected_stderr = expected_stderr
|
||
|
act.execute()
|
||
|
assert act.clean_stdout == act.clean_expected_stdout and act.clean_stderr == act.clean_expected_stderr
|