6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_0790_test.py

72 lines
1.5 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-1175
ISSUE: 1175
TITLE: Alter view
DESCRIPTION:
JIRA: CORE-790
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
init_script = """create table users (
2021-04-26 20:07:00 +02:00
id integer,
name varchar(20),
passwd varchar(20)
);
create view v_users as
select name from users;
commit;"""
2022-01-18 20:45:21 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
test_script = """alter view v_users (id, name, passwd ) as
2021-04-26 20:07:00 +02:00
select id, name, passwd from users;
commit;
show view v_users;
create view v_users_name as
select name from v_users;
commit;
alter view v_users (id, name ) as
select id, name from users;
commit;
show view v_users;
show view v_users_name;
"""
2022-01-18 20:45:21 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
expected_stdout = """Database: test.fdb, User: SYSDBA
2021-04-26 20:07:00 +02:00
SQL> CON> SQL> SQL> ID INTEGER Nullable
NAME VARCHAR(20) Nullable
PASSWD VARCHAR(20) Nullable
View Source:
==== ======
select id, name, passwd from users
SQL> CON> SQL> SQL> CON> SQL> SQL> ID INTEGER Nullable
NAME VARCHAR(20) Nullable
View Source:
==== ======
select id, name from users
SQL> NAME VARCHAR(20) Nullable
View Source:
==== ======
select name from v_users
2021-11-10 19:02:05 +01:00
SQL> SQL> SQL> SQL>
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +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