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

66 lines
1.5 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-25 22:55:48 +01:00
"""
ID: issue-5847
ISSUE: 5847
TITLE: Signature of packaged functions is not checked for mismatch with [NOT] DETERMINISTIC attribute
DESCRIPTION:
JIRA: CORE-5580
FBTEST: bugs.core_5580
2022-01-25 22:55:48 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set term ^;
recreate package pk1 as
begin
function f1() returns int deterministic;
function f2() returns int not deterministic;
end
^
recreate package body pk1 as
begin
function f1() returns int not deterministic as
begin
return 123;
end
2022-01-25 22:55:48 +01:00
2021-04-26 20:07:00 +02:00
function f2() returns int not deterministic as
begin
return 123 * rand();
end
2022-01-25 22:55:48 +01:00
2021-04-26 20:07:00 +02:00
end
^
set term ;^
commit;
set list on;
select pk1.f1() as f1_result from rdb$database;
select pk1.f2() as f2_result from rdb$database;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
expected_stderr = """
2021-04-26 20:07:00 +02:00
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-RECREATE PACKAGE BODY PK1 failed
-Function F1 has a signature mismatch on package body PK1
Statement failed, SQLSTATE = 2F000
Cannot execute function F1 of the unimplemented package PK1
Statement failed, SQLSTATE = 2F000
Cannot execute function F2 of the unimplemented package PK1
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-25 22:55:48 +01:00
def test_1(act: Action):
act.expected_stderr = expected_stderr
act.execute()
assert act.clean_stderr == act.clean_expected_stderr