6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_2578_test.py

63 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-2988
ISSUE: 2988
TITLE: select rdb$db_key from a view with a more than 1 table joined, results in conversion error
DESCRIPTION:
JIRA: CORE-2578
FBTEST: bugs.core_2578
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
init_script = """CREATE TABLE TABLE_A (
2021-04-26 20:07:00 +02:00
F_A INTEGER,
F_B INTEGER
);
CREATE TABLE TABLE_B(
F_A INTEGER,
F_C INTEGER
);
CREATE VIEW VIEW_A(
K1,
K2,
F_A,
F_B,
F_C)
AS
select A.rdb$db_key, B.rdb$db_key, A.F_A, A.F_B, B.F_C from table_A A
left join table_B B on A.F_A = B.F_A;
commit;
insert into TABLE_A (F_A,F_B) values (1,1) ;
insert into TABLE_B (F_A,F_C) values (1,1) ;
commit;
"""
2022-01-21 18:49:26 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """select rdb$db_key from VIEW_A order by 1 ;
2021-04-26 20:07:00 +02:00
"""
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
DB_KEY
================================
81000000010000008000000001000000
"""
2022-01-21 18:49:26 +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