6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/bugs/core_6286_test.py

48 lines
1.6 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-6528
ISSUE: 6528
TITLE: Make usage of TIMESTAMP/TIME WITH TIME ZONE convenient for users when appropriate
ICU library is not installed on the client side
2022-01-27 20:08:36 +01:00
DESCRIPTION:
Test only verifies ability to use 'EXTENDED' clause in SET BIND statement.
We can not simulate absense of appropriate ICU library and for this reason values of time/timestamp are suppressednot checked.
JIRA: CORE-6286
FBTEST: bugs.core_6286
2022-01-27 20:08:36 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set sqlda_display on;
set bind of time with time zone to extended;
select time '11:11:11.111 Indian/Cocos' as "check_bind_time_with_zone_to_extended" from rdb$database;
set bind of timestamp with time zone to extended;
select timestamp '2018-12-31 12:31:42.543 Pacific/Fiji' as "check_bind_timestamp_with_zone_to_extended" from rdb$database;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
act = isql_act('db', test_script, substitutions=[('^((?!(sqltype|extended)).)*$', ''),
('[ \t]+', ' ')])
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
01: sqltype: 32750 EXTENDED TIME WITH TIME ZONE scale: 0 subtype: 0 len: 8
: name: CONSTANT alias: check_bind_time_with_zone_to_extended
check_bind_time_with_zone_to_extended
01: sqltype: 32748 EXTENDED TIMESTAMP WITH TIME ZONE scale: 0 subtype: 0 len: 12
: name: CONSTANT alias: check_bind_timestamp_with_zone_to_extended
check_bind_timestamp_with_zone_to_extended
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=4.0.0')
2022-01-27 20:08:36 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout