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

48 lines
855 B
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-2948
ISSUE: 2948
TITLE: PSQL doesnt allow to use singleton query result as input parameter of stored procedure when procedure accessed using 'execute procedure'
DESCRIPTION:
JIRA: CORE-2538
FBTEST: bugs.core_2538
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
init_script = """set term ^ ;
2021-04-26 20:07:00 +02:00
create procedure P (I integer)
returns (O integer)
AS
BEGIN
SUSPEND;
END ^
"""
2022-01-21 18:49:26 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """set term ^ ;
2021-04-26 20:07:00 +02:00
execute block
as
declare variable i integer;
begin
select 1 from P((select 1 from rdb$database)) into :i;
end ^
execute block
as
declare variable i integer;
begin
execute procedure P((select 1 from rdb$database)) returning_values :i;
end ^
"""
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
@pytest.mark.version('>=3')
def test_1(act: Action):
2022-01-25 22:55:48 +01:00
act.execute()