6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 22:13:05 +01:00
firebird-qa/tests/bugs/core_5710_test.py

64 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-26 21:10:46 +01:00
"""
ID: issue-5976
ISSUE: 5976
TITLE: Datatype declaration DECFLOAT without precision should use a default precision
DESCRIPTION:
JIRA: CORE-5710
FBTEST: bugs.core_5710
2022-01-26 21:10:46 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
recreate table test( distance_small decfloat(16), distance_huge decfloat(34), distance_default decfloat );
commit;
select
r.rdb$field_name
,f.rdb$field_length
,f.rdb$field_scale
,f.rdb$field_type
,f.rdb$field_precision
from rdb$fields f
join rdb$relation_fields r on f.rdb$field_name = r.rdb$field_source
2022-01-26 21:10:46 +01:00
where
2021-04-26 20:07:00 +02:00
r.rdb$relation_name = upper('test')
and r.rdb$field_name starting with upper('distance')
order by r.rdb$field_position
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
expected_stdout = """
RDB$FIELD_NAME DISTANCE_SMALL
2021-04-26 20:07:00 +02:00
RDB$FIELD_LENGTH 8
RDB$FIELD_SCALE 0
RDB$FIELD_TYPE 24
RDB$FIELD_PRECISION 16
2022-01-26 21:10:46 +01:00
RDB$FIELD_NAME DISTANCE_HUGE
2021-04-26 20:07:00 +02:00
RDB$FIELD_LENGTH 16
RDB$FIELD_SCALE 0
RDB$FIELD_TYPE 25
RDB$FIELD_PRECISION 34
2022-01-26 21:10:46 +01:00
RDB$FIELD_NAME DISTANCE_DEFAULT
2021-04-26 20:07:00 +02:00
RDB$FIELD_LENGTH 16
RDB$FIELD_SCALE 0
RDB$FIELD_TYPE 25
RDB$FIELD_PRECISION 34
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=4.0')
2022-01-26 21:10:46 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout