2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
|
|
|
ID: issue-4889
|
|
|
|
ISSUE: 4889
|
2022-02-02 15:46:19 +01:00
|
|
|
TITLE: Incorrect error for PSQL function when the number of actual arguments does
|
|
|
|
not match the number of formal arguments
|
2022-01-23 20:41:55 +01:00
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4572
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4572
|
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 function fn_multiplier ( a_val int, a_times int ) returns bigint
|
|
|
|
as
|
|
|
|
begin
|
|
|
|
return a_val * a_times;
|
|
|
|
end
|
|
|
|
^
|
2022-01-23 20:41:55 +01:00
|
|
|
|
2021-04-26 20:07:00 +02:00
|
|
|
create or alter procedure sp_multiplier (a_val int, a_times int )
|
|
|
|
returns (result bigint)
|
|
|
|
as
|
|
|
|
begin
|
|
|
|
result = a_val * a_times;
|
|
|
|
end
|
|
|
|
^
|
|
|
|
set term ;^
|
|
|
|
commit;
|
2022-01-23 20:41:55 +01:00
|
|
|
|
2021-04-26 20:07:00 +02:00
|
|
|
-- Confirmed on WI-T3.0.0.31374 Firebird 3.0 Beta 1:
|
|
|
|
-- Statement failed, SQLSTATE = 39000
|
|
|
|
-- invalid request BLR at offset 50
|
|
|
|
-- -function FN_MULTIPLIER could not be matched
|
|
|
|
select fn_multiplier(191) as t from rdb$database;
|
|
|
|
|
|
|
|
execute procedure sp_multiplier(191);
|
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_stderr = """
|
2021-04-26 20:07:00 +02:00
|
|
|
Statement failed, SQLSTATE = 07001
|
|
|
|
Dynamic SQL Error
|
|
|
|
-Input parameter mismatch for function FN_MULTIPLIER
|
|
|
|
|
|
|
|
Statement failed, SQLSTATE = 07001
|
|
|
|
Dynamic SQL Error
|
|
|
|
-Input parameter mismatch for procedure SP_MULTIPLIER
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-23 20:41:55 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stderr = expected_stderr
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stderr == act.clean_expected_stderr
|
2021-04-26 20:07:00 +02:00
|
|
|
|