2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
|
|
|
ID: issue-3673
|
|
|
|
ISSUE: 3673
|
2022-02-02 15:46:19 +01:00
|
|
|
TITLE: Invariant sub-query is treated as variant thus causing multiple invokations
|
|
|
|
of a nested stored procedure
|
2022-01-22 21:59:15 +01:00
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3306
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3306
|
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
|
|
|
init_script = """SET TERM !!;
|
2021-04-26 20:07:00 +02:00
|
|
|
Create Table tt_table(Field1 varchar(100))!!
|
|
|
|
Create Or Alter PROCEDURE SPR_TEST (pName Varchar(2000)) RETURNS (sValue Varchar(255)) AS
|
|
|
|
BEGIN
|
|
|
|
Insert Into tt_table(field1) values(:pName);
|
|
|
|
sValue=:pName;
|
|
|
|
suspend;
|
|
|
|
End!!
|
|
|
|
COMMIT!!
|
|
|
|
SET TERM ;!!
|
|
|
|
Select count(*)
|
|
|
|
from rdb$types
|
|
|
|
where rdb$field_name like (select sValue From spr_test('SIMSIM'));
|
|
|
|
COMMIT;"""
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = isql_act('db', "select count(*) from tt_table;")
|
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
|
|
|
COUNT
|
|
|
|
=====================
|
|
|
|
1
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-22 21:59:15 +01:00
|
|
|
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
|
|
|
|