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

79 lines
3.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-20 17:32:14 +01:00
"""
ID: issue-1737
ISSUE: 1737
TITLE: Error "Identifier ... is too long using multiple (nested) derived tables
DESCRIPTION:
JIRA: CORE-1318
FBTEST: bugs.core_1318
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
select 0*count(*) cnt
from (
2022-01-20 17:32:14 +01:00
select A1.ID
2021-04-26 20:07:00 +02:00
from(
select A2.ID from(
select A3.ID from(
select A4.ID from(
select A5.ID from(
select A6.ID from(
select A7.ID from(
select A8.ID from(
select A9.ID from(
select A10.ID from(
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 1
2022-01-20 17:32:14 +01:00
) as A10
union
2021-04-26 20:07:00 +02:00
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 2
2022-01-20 17:32:14 +01:00
) as A9
2021-04-26 20:07:00 +02:00
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 3
) as A8
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 4
) as A7
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 5
) as A6
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 6
) as A5
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 7
) as A4
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 8
) as A3
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 9
) as A2
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 10
) as A1
union
select rdb$relations.rdb$relation_id as id from rdb$relations where rdb$relations.rdb$relation_id = 11
)
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-02-07 18:03:19 +01:00
act = isql_act('db', test_script, substitutions=[('[ ]+', ' ')])
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
CNT 0
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +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