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

40 lines
1.3 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-23 20:41:55 +01:00
"""
ID: issue-4530
ISSUE: 4530
TITLE: ISQL -x does not output the START WITH clause of generators/sequences
DESCRIPTION:
JIRA: CORE-4205
FBTEST: bugs.core_4205
2022-01-23 20:41:55 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
init_script = """
2021-04-26 20:07:00 +02:00
recreate sequence tmp_gen_42051 start with 9223372036854775807 increment by -2147483647;
recreate sequence tmp_gen_42052 start with -9223372036854775808 increment by 2147483647;
recreate sequence tmp_gen_42053 start with 9223372036854775807 increment by 2147483647;
recreate sequence tmp_gen_42054 start with -9223372036854775808 increment by -2147483647;
2021-11-18 20:15:37 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
db = db_factory(sql_dialect=3, init=init_script)
2021-11-18 20:15:37 +01:00
2022-01-23 20:41:55 +01:00
act = python_act('db', substitutions=[('^((?!CREATE GENERATOR).)*$', '')])
2021-04-26 20:07:00 +02:00
2022-01-23 20:41:55 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
CREATE GENERATOR TMP_GEN_42051 START WITH 9223372036854775807 INCREMENT -2147483647;
CREATE GENERATOR TMP_GEN_42052 START WITH -9223372036854775808 INCREMENT 2147483647;
CREATE GENERATOR TMP_GEN_42053 START WITH 9223372036854775807 INCREMENT 2147483647;
CREATE GENERATOR TMP_GEN_42054 START WITH -9223372036854775808 INCREMENT -2147483647;
2021-11-18 20:15:37 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-23 20:41:55 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.isql(switches=['-x'])
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00