6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\gh_7638_test.py: Checked on 5.0.0.1093 (intermediate build).

This commit is contained in:
pavel-zotov 2023-06-28 15:50:36 +03:00
parent 7093239465
commit 424864fcfb

View File

@ -0,0 +1,47 @@
#coding:utf-8
"""
ID: issue-7638
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7638
TITLE: OVERRIDING USER VALUE should be allowed for GENERATED ALWAYS AS IDENTITY
DESCRIPTION:
NOTES:
[29.06.2023] pzotov
Checked on 5.0.0.1093 (intermediate build).
"""
import pytest
from firebird.qa import *
db = db_factory()
test_script = """
set list on;
recreate table IDENTITY_ALWAYS (
ID bigint generated always as identity constraint pk_identity_always primary key,
VAL varchar(10)
);
commit;
insert into IDENTITY_ALWAYS (ID, VAL) overriding user value values (-9223372036854775808, 'B1') returning ID, VAL;
insert into IDENTITY_ALWAYS (ID, VAL) overriding user value values (null, 'B2') returning ID, VAL;
insert into IDENTITY_ALWAYS (ID, VAL) overriding user value values (cast(9223372036854775808 as int128), 'B3') returning ID, VAL;
"""
act = isql_act('db', test_script)
expected_stdout = """
ID 1
VAL B1
ID 2
VAL B2
ID 3
VAL B3
"""
@pytest.mark.version('>=5.0')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout