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

45 lines
1.1 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-20 17:32:14 +01:00
"""
ID: issue-1735
ISSUE: 1735
TITLE: NOT NULL constraint for procedure parameters and variables
DESCRIPTION:
JIRA: CORE-1316
FBTEST: bugs.core_1316
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
test_script = """create procedure get_something(id integer not null) as begin end;
2021-04-26 20:07:00 +02:00
commit;
execute procedure get_something(NULL);
execute procedure get_something(1);
set term ^;
create procedure p0(inp int) as declare i int not null; begin i = inp; end^
set term ;^
commit;
execute procedure p0(null);
execute procedure p0(1);
"""
2022-01-20 17:32:14 +01:00
act = isql_act('db', test_script, substitutions=[('line: \\d+, col: \\d+', '')])
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
expected_stderr = """Statement failed, SQLSTATE = 42000
2021-04-26 20:07:00 +02:00
validation error for variable ID, value "*** null ***"
-At procedure 'GET_SOMETHING'
Statement failed, SQLSTATE = 42000
validation error for variable I, value "*** null ***"
-At procedure 'P0' line: 1, col: 63
"""
2022-01-20 17:32:14 +01:00
@pytest.mark.version('>=3')
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