6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_1004_test.py

74 lines
1.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_1004
# title: context already in use (BLR error)
2021-12-19 22:25:36 +01:00
# decription:
2021-04-26 20:07:00 +02:00
# tracker_id: CORE-1004
# min_versions: []
# versions: 2.0.1
# qmid: bugs.core_1004
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.0.1
# resources: None
substitutions_1 = []
init_script_1 = """SET TERM ^;
CREATE OR ALTER PROCEDURE GET_REL_NAME (REL_ID INT) RETURNS (REL_NAME VARCHAR(32))
AS
BEGIN
FOR SELECT R.RDB$RELATION_NAME
FROM RDB$RELATIONS R
WHERE R.RDB$RELATION_ID = :REL_ID
INTO :REL_NAME
DO
SUSPEND;
END^
SET TERM ;^
COMMIT;
"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """SET TERM ^;
CREATE OR ALTER PROCEDURE BUG
AS
DECLARE C CURSOR FOR (
SELECT (SELECT REL_NAME FROM GET_REL_NAME(R.RDB$RELATION_ID))
FROM RDB$RELATIONS R
);
DECLARE REL_NAME VARCHAR(32);
BEGIN
OPEN C;
WHILE (1 = 1) DO
BEGIN
FETCH C INTO :REL_NAME;
IF (ROW_COUNT = 0)
THEN LEAVE;
END
CLOSE C;
END^
SET TERM ;^
COMMIT;
"""
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
@pytest.mark.version('>=2.0.1')
2021-04-28 12:42:11 +02:00
def test_1(act_1: Action):
2021-04-26 20:07:00 +02:00
act_1.execute()