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

57 lines
1.2 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-19 17:54:56 +01:00
"""
ID: issue-1568
ISSUE: 1568
TITLE: AV in rse\\invalidate_child_rpbs for recursive queies
DESCRIPTION:
JIRA: CORE-1146
FBTEST: bugs.core_1146
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 = """
2021-04-26 20:07:00 +02:00
recreate table c (
id integer,
name varchar(100)
);
recreate table t (
id integer,
ownercode integer,
code integer
);
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
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 = """
2021-04-26 20:07:00 +02:00
-- Updated code to recent FB version: add prefixes to every field from the query
with recursive x as
(
select --1 as step,
t.id, t.ownercode, t.code, c2.name as ownclass, c1.name as class
from t inner join c c1 on c1.id = t.code
left join c c2 on c2.id = t.ownercode
where ownercode = 0
2022-01-19 17:54:56 +01:00
2021-04-26 20:07:00 +02:00
union all
2022-01-19 17:54:56 +01:00
2021-04-26 20:07:00 +02:00
select --x.step+1
t.id, t.ownercode, x.code, c2.name as ownclass, c1.name as class
from t inner join c c1 on c1.id = t.code
left join c c2 on c2.id = t.ownercode
inner join x on t.ownercode = x.code
)
select * from x
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
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
@pytest.mark.version('>=3')
def test_1(act: Action):
2022-01-25 22:55:48 +01:00
act.execute()