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

59 lines
1.4 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-3385
ISSUE: 3385
TITLE: Procedure suspend check may cause restore to fail
DESCRIPTION:
JIRA: CORE-3003
FBTEST: bugs.core_3003
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
db = db_factory(from_backup='c3003-ods11.fbk')
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
2022-01-22 21:59:15 +01:00
select rdb$procedure_name, rdb$procedure_source
from rdb$procedures
2021-04-26 20:07:00 +02:00
where upper( rdb$procedure_name ) in ( upper('sp_01'), upper('sp_02') )
order by rdb$procedure_name
;
2022-01-22 21:59:15 +01:00
select RDB$PROCEDURE_NAME, RDB$PARAMETER_NAME, RDB$PARAMETER_TYPE,RDB$PARAMETER_MECHANISM
2021-04-26 20:07:00 +02:00
from rdb$procedure_parameters
where upper( rdb$procedure_name ) in ( upper('sp_01'), upper('sp_02') )
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
act = isql_act('db', test_script, substitutions=[('RDB\\$PROCEDURE_SOURCE.*', '')])
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
RDB$PROCEDURE_NAME SP_01
RDB$PROCEDURE_SOURCE 1a:1
begin
n = 1;
end
2022-01-22 21:59:15 +01:00
2021-04-26 20:07:00 +02:00
RDB$PROCEDURE_NAME SP_02
RDB$PROCEDURE_SOURCE 1a:4
declare n int;
begin
select n from sp_01 into n;
end
2022-01-22 21:59:15 +01:00
2021-04-26 20:07:00 +02:00
RDB$PROCEDURE_NAME SP_01
RDB$PARAMETER_NAME N
RDB$PARAMETER_TYPE 1
RDB$PARAMETER_MECHANISM 0
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
@pytest.mark.version('>=3')
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