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

41 lines
987 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-1384
ISSUE: 1384
TITLE: Make RDB$DB_KEY in outer joins return NULL when appropriate
DESCRIPTION:
JIRA: CORE-979
FBTEST: bugs.core_0979
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 = """CREATE TABLE employee( id_employee INTEGER , prenom VARCHAR(20) ,id_department INTEGER, PRIMARY KEY(id_employee));
2021-04-26 20:07:00 +02:00
CREATE TABLE department(id_department INTEGER, name VARCHAR(20));
COMMIT;
INSERT INTO employee(id_employee, prenom,id_department) VALUES (1,'benoit',1 );
COMMIT;
"""
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 = """select department.rdb$db_key from employee
2021-04-26 20:07:00 +02:00
left OUTER JOIN department
on department.id_department = employee.id_department;
"""
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 = """DB_KEY
2021-04-26 20:07:00 +02:00
================
<null>"""
2022-01-18 20:45:21 +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