2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5971
|
|
|
|
ISSUE: 5971
|
|
|
|
TITLE: Store precision of DECFLOAT in RDB$FIELDS
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-5705
|
|
|
|
"""
|
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;
|
|
|
|
set count on;
|
|
|
|
create domain dm_df16 as decfloat(16);
|
|
|
|
create domain dm_df34 as decfloat(34);
|
|
|
|
commit;
|
2022-01-26 21:10:46 +01:00
|
|
|
select rdb$field_name, rdb$field_precision
|
|
|
|
from rdb$fields
|
|
|
|
where rdb$field_name in (upper('dm_df16'), upper('dm_df34'))
|
2021-04-26 20:07:00 +02:00
|
|
|
order by 1;
|
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 DM_DF16
|
2021-04-26 20:07:00 +02:00
|
|
|
RDB$FIELD_PRECISION 16
|
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
RDB$FIELD_NAME DM_DF34
|
2021-04-26 20:07:00 +02:00
|
|
|
RDB$FIELD_PRECISION 34
|
|
|
|
|
|
|
|
Records affected: 2
|
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
|
2021-04-26 20:07:00 +02:00
|
|
|
|