mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\gh_7574_test.py: Confirmed problem on 5.0.0.1049. Checked on 5.0.0.1050 -- all fine.
This commit is contained in:
parent
8624503a16
commit
e389d9d056
59
tests/bugs/gh_7574_test.py
Normal file
59
tests/bugs/gh_7574_test.py
Normal file
@ -0,0 +1,59 @@
|
||||
#coding:utf-8
|
||||
|
||||
"""
|
||||
ID: issue-7574
|
||||
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7574
|
||||
TITLE: Derived table syntax allows dangling "AS"
|
||||
NOTES:
|
||||
[17.05.2023] pzotov
|
||||
Confirmed problem on 5.0.0.1049. Checked on 5.0.0.1050 -- all fine.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from firebird.qa import *
|
||||
|
||||
db = db_factory()
|
||||
|
||||
test_script = """
|
||||
set heading off;
|
||||
-- All following statements must FAIL since 5.0.0.1050:
|
||||
select i from (select 1 as i from rdb$database) as;
|
||||
-------------------------------------
|
||||
with
|
||||
a as
|
||||
(select 2 as i from rdb$database)
|
||||
select * from (select i from a) as
|
||||
;
|
||||
-------------------------------------
|
||||
with recursive
|
||||
r as (
|
||||
select 0 as i from rdb$database
|
||||
UNION ALL
|
||||
select r.i+1 as i from r where r.i < 3
|
||||
)
|
||||
select * from (select i from r) as
|
||||
;
|
||||
"""
|
||||
|
||||
act = isql_act('db', test_script, substitutions = [('line \\d+, column \\d+', '')])
|
||||
|
||||
expected_stdout = """
|
||||
Statement failed, SQLSTATE = 42000
|
||||
Dynamic SQL Error
|
||||
-SQL error code = -104
|
||||
-Unexpected end of command - line 1, column 49
|
||||
Statement failed, SQLSTATE = 42000
|
||||
Dynamic SQL Error
|
||||
-SQL error code = -104
|
||||
-Unexpected end of command - line 4, column 37
|
||||
Statement failed, SQLSTATE = 42000
|
||||
Dynamic SQL Error
|
||||
-SQL error code = -104
|
||||
-Unexpected end of command - line 7, column 37
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=5.0')
|
||||
def test_1(act: Action):
|
||||
act.expected_stdout = expected_stdout
|
||||
act.execute(combine_output = True)
|
||||
assert act.clean_stdout == act.clean_expected_stdout
|
Loading…
Reference in New Issue
Block a user