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

58 lines
1.1 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-3469
ISSUE: 3469
TITLE: Incorrect LEFT JOIN result using table and derived constant subquery
DESCRIPTION:
JIRA: CORE-3090
FBTEST: bugs.core_3090
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 = """recreate table test_err (id int);
2021-04-26 20:07:00 +02:00
insert into test_err (ID) values (1);
insert into test_err (ID) values (2);
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
test_script = """select *
2021-04-26 20:07:00 +02:00
from test_err t
left join (select 1 id from rdb$database) a on a.id = t.id;
select
RESULT
from (select
'Well' as RESULT
from (select
(select 'Does not work' from RDB$DATABASE) as D
from RDB$DATABASE d) i
left join RDB$DATABASE on 1=0) j
left join RDB$DATABASE on 1=0;
"""
2022-01-22 21:59:15 +01:00
act = isql_act('db', test_script)
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
ID ID
============ ============
1 1
2 <null>
RESULT
======
Well
"""
@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