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

47 lines
1.0 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-4040
ISSUE: 4040
TITLE: Cannot drop a NOT NULL constraint on a field participating in the UNIQUE constraint
DESCRIPTION:
JIRA: CORE-3692
FBTEST: bugs.core_3692
NOTES:
[05.10.2023] pzotov
Removed SHOW command for check result because its output often changes.
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
init_script = """
recreate table test (s varchar(250) character set none not null);
2022-01-22 21:59:15 +01:00
commit;
alter table test add constraint test_unq unique (s);
2022-01-22 21:59:15 +01:00
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
test_script = """
set bail on;
set list on;
alter table test alter column s drop not null;
2021-04-26 20:07:00 +02:00
commit;
insert into test(s) values(null);
select s from test;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
act = isql_act('db', test_script, substitutions = [ ('[ \t]+', ''), ] )
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
expected_stdout = """
S <null>
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute(combine_output = True)
2022-01-22 21:59:15 +01:00
assert act.clean_stdout == act.clean_expected_stdout