Skip to content

Commit 97999d4

Browse files
committed
Added/Updated tests\bugs\gh_7730_test.py: Checked on 5.0.0.1177, 4.0.4.2982 (intermediate snapshots).
1 parent 831d9f4 commit 97999d4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/bugs/gh_7730_test.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: issue-7730
5+
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7730
6+
TITLE: Server ignores the size of VARCHAR when performing SET BIND ... TO VARCHAR(N)
7+
DESCRIPTION:
8+
NOTES:
9+
[25.08.2023] pzotov
10+
Confirmed problem on 5.0.0.1169, 4.0.4.2982
11+
Checked on 5.0.0.1177, 4.0.4.2982 (intermediate snapshots).
12+
"""
13+
14+
import locale
15+
import pytest
16+
from firebird.qa import *
17+
18+
db = db_factory()
19+
act = python_act('db', substitutions=[('^((?!sqltype:).)*$',''),('[ \t]+',' ')])
20+
21+
CHK_TIMESTAMP = '2023-08-29 01:02:03.0123 +03:00'
22+
test_sql = f"""
23+
SET BIND OF TIMESTAMP WITH TIME ZONE TO varchar(128);
24+
set sqlda_display on;
25+
set planonly;
26+
select timestamp '{CHK_TIMESTAMP}' from rdb$database;
27+
"""
28+
29+
expected_stdout = f"""
30+
01: sqltype: 448 VARYING scale: 0 subtype: 0 len: 128 charset: 0 NONE
31+
"""
32+
33+
@pytest.mark.version('>=4.0.4')
34+
def test_1(act: Action):
35+
act.expected_stdout = expected_stdout
36+
act.isql(switches=['-q'], input = test_sql, combine_output = True, io_enc = locale.getpreferredencoding())
37+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)