mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
58 lines
1.2 KiB
Python
58 lines
1.2 KiB
Python
#coding:utf-8
|
|
|
|
"""
|
|
ID: issue-4531
|
|
ISSUE: 4531
|
|
TITLE: Add RESTART [WITH] clause for alter identity columns
|
|
DESCRIPTION:
|
|
JIRA: CORE-4206
|
|
FBTEST: bugs.core_4206
|
|
"""
|
|
|
|
import pytest
|
|
from firebird.qa import *
|
|
|
|
db = db_factory()
|
|
|
|
test_script = """
|
|
recreate table test(
|
|
id int generated by default as identity
|
|
,x int
|
|
);
|
|
commit;
|
|
insert into test(x) values(1);
|
|
insert into test(x) values(1);
|
|
insert into test(x) values(1);
|
|
commit;
|
|
|
|
alter table test alter id restart with 40;
|
|
commit;
|
|
|
|
insert into test(x) values(2);
|
|
insert into test(x) values(2);
|
|
insert into test(x) values(2);
|
|
commit;
|
|
|
|
set list on;
|
|
select x,max(id)-min(id) as id_diff
|
|
from test
|
|
group by x
|
|
order by x;
|
|
"""
|
|
|
|
act = isql_act('db', test_script, substitutions=[('=.*', ''), ('[\t ]+', ' ')])
|
|
|
|
expected_stdout = """
|
|
X 1
|
|
ID_DIFF 2
|
|
|
|
X 2
|
|
ID_DIFF 2
|
|
"""
|
|
|
|
@pytest.mark.version('>=3.0')
|
|
def test_1(act: Action):
|
|
act.expected_stdout = expected_stdout
|
|
act.execute()
|
|
assert act.clean_stdout == act.clean_expected_stdout
|