2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5414
|
|
|
|
ISSUE: 5414
|
2022-02-02 15:46:19 +01:00
|
|
|
TITLE: Compiler issues message about "invalid request BLR" when attempt to compile
|
|
|
|
wrong DDL of view with both subquery and "WITH CHECK OPTION" in its DDL
|
2022-01-25 22:55:48 +01:00
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-5130
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_5130
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
-- Confirmed proper result on: WI-V3.0.0.32380
|
|
|
|
create or alter view v1 as select 1 id from rdb$database;
|
|
|
|
recreate table t1(id int, x int, y int);
|
|
|
|
commit;
|
|
|
|
|
|
|
|
alter view v1 as
|
|
|
|
select * from t1 a
|
|
|
|
where
|
|
|
|
not exists(select * from t1 r where r.x > a.x)
|
|
|
|
with check option
|
2022-01-25 22:55:48 +01:00
|
|
|
;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
expected_stderr = """
|
2021-04-26 20:07:00 +02:00
|
|
|
Statement failed, SQLSTATE = 42000
|
|
|
|
unsuccessful metadata update
|
|
|
|
-ALTER VIEW V1 failed
|
|
|
|
-Dynamic SQL Error
|
|
|
|
-SQL error code = -607
|
|
|
|
-No subqueries permitted for VIEW WITH CHECK OPTION
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-25 22:55:48 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stderr = expected_stderr
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stderr == act.clean_expected_stderr
|