2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-21 18:49:26 +01:00
|
|
|
"""
|
|
|
|
ID: issue-3325
|
|
|
|
ISSUE: 3325
|
|
|
|
TITLE: Parsing error recursive query with two recursive parts
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-2943
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_2943
|
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
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-21 18:49:26 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set list on;
|
|
|
|
with recursive
|
|
|
|
tree (NAME) as (
|
|
|
|
select r.rdb$relation_name from rdb$relations r
|
|
|
|
union all
|
|
|
|
select r2.rdb$relation_name || tree.NAME from rdb$relations r2, tree
|
|
|
|
where 1 = 0
|
|
|
|
),
|
|
|
|
tree_2 as (
|
|
|
|
select c.rdb$character_set_name from rdb$character_sets c
|
|
|
|
union all
|
|
|
|
select c2.rdb$character_set_name from rdb$character_sets c2, tree_2
|
|
|
|
where 1 = 0
|
|
|
|
)
|
|
|
|
select * from tree, tree_2 where NAME=upper('RDB$PAGES') and RDB$CHARACTER_SET_NAME=upper('NONE');
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
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
|
|
|
NAME RDB$PAGES
|
|
|
|
RDB$CHARACTER_SET_NAME NONE
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
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
|
|
|
|