2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
"""
|
|
|
|
ID: issue-1307
|
|
|
|
ISSUE: 1307
|
|
|
|
TITLE: Garbage in plan output of complex statement
|
|
|
|
DESCRIPTION:
|
|
|
|
This is unfortunate case. The fix for 2.1 went through several "adjustments" and we've
|
|
|
|
get lost in changes. The result is that this was not properly fixed in 2.1 line (server
|
|
|
|
doesn't crash, but don't returns the truncated plan as supposed either). Now when 2.1
|
|
|
|
line is at 2.1.3 we can hope for proper fix in 2.1.4. It should work as intended in 2.5 line.
|
|
|
|
JIRA: CORE-908
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_0908
|
2022-01-18 20:45:21 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
init_script = """set term ^;
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
create procedure big_plan
|
|
|
|
returns (x integer)
|
|
|
|
as
|
|
|
|
begin
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
select 1 from rdb$database into :x;
|
|
|
|
/* select 1 from rdb$relations into :x; */
|
|
|
|
suspend;
|
|
|
|
end ^
|
|
|
|
set term ;^
|
|
|
|
"""
|
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
test_script = """set plan on;
|
2021-04-26 20:07:00 +02:00
|
|
|
select * from big_plan ;
|
|
|
|
"""
|
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
expected_stdout = """PLAN (BIG_PLAN NATURAL)
|
2021-04-26 20:07:00 +02:00
|
|
|
X
|
|
|
|
============
|
|
|
|
1
|
|
|
|
"""
|
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-18 20:45:21 +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
|
|
|
|