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

47 lines
1.0 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-19 17:54:56 +01:00
"""
ID: issue-1439
ISSUE: 1439
TITLE: Server crashes at runtime when an explicit MERGE plan is specified over a few JOIN ones
DESCRIPTION:
JIRA: CORE-1025
FBTEST: bugs.core_1025
2022-01-19 17:54:56 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
init_script = """recreate table t (id int not null);
2021-04-26 20:07:00 +02:00
alter table t add constraint pk primary key (id);
insert into t values (1);
commit;
"""
2022-01-19 17:54:56 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
test_script = """select *
2021-04-26 20:07:00 +02:00
from t t1, t t2, t t3, t t4
where t1.id = t2.id
and t2.id = t3.id
and t3.id = t4.id
PLAN MERGE (JOIN (T1 NATURAL, T2 INDEX (PK)), JOIN(T3 NATURAL, T4 INDEX (PK)));
"""
2022-01-19 17:54:56 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
expected_stdout = """ID ID ID ID
2021-04-26 20:07:00 +02:00
============ ============ ============ ============
1 1 1 1
"""
2022-01-19 17:54:56 +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