6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 22:13:05 +01:00
firebird-qa/tests/functional/view/create/test_04.py

38 lines
807 B
Python

#coding:utf-8
"""
ID: view.create-04
TITLE: CREATE VIEW - bad number of columns
DESCRIPTION:
FBTEST: functional.view.create.04
"""
import pytest
from firebird.qa import *
init_script = """CREATE TABLE tb(id INT);
"""
db = db_factory(init=init_script)
test_script = """CREATE VIEW test (id) AS SELECT id,5 FROM tb;
SHOW VIEW test;
"""
act = isql_act('db', test_script)
expected_stderr = """Statement failed, SQLSTATE = 07002
unsuccessful metadata update
-CREATE VIEW TEST failed
-SQL error code = -607
-Invalid command
-number of columns does not match select list
There is no view TEST in this database
"""
@pytest.mark.version('>=3.0')
def test_1(act: Action):
act.expected_stderr = expected_stderr
act.execute()
assert act.clean_stderr == act.clean_expected_stderr