2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
|
|
|
ID: issue-4482
|
|
|
|
ISSUE: 4482
|
|
|
|
TITLE: External routines DDL in Packages wrongly report error for termination with semi-colon
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4155
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4155
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
import pytest
|
|
|
|
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
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set term ^;
|
|
|
|
create or alter package pkg
|
|
|
|
as
|
|
|
|
begin
|
|
|
|
function sum_args (
|
|
|
|
n1 integer,
|
|
|
|
n2 integer,
|
|
|
|
n3 integer
|
|
|
|
) returns integer;
|
|
|
|
end
|
|
|
|
^
|
|
|
|
recreate package body pkg
|
|
|
|
as
|
|
|
|
begin
|
|
|
|
function sum_args (
|
|
|
|
n1 integer,
|
|
|
|
n2 integer,
|
|
|
|
n3 integer
|
|
|
|
) returns integer
|
|
|
|
external name 'udrcpp_example!sum_args'
|
|
|
|
engine udr; -- error with the semi-colon and works without it
|
|
|
|
end
|
|
|
|
^
|
|
|
|
set term ;^
|
|
|
|
commit;
|
|
|
|
set list on;
|
|
|
|
select pkg.sum_args(111,555,777) from rdb$database;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
SUM_ARGS 1443
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
2022-01-23 20:41:55 +01:00
|
|
|
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
|
|
|
|