6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\gh_7916_test.py: Checked on 6.0.0.257.

This commit is contained in:
pavel-zotov 2024-02-10 13:52:04 +03:00
parent f844e83418
commit 1d314d55ec

View File

@ -0,0 +1,54 @@
#coding:utf-8
"""
ID: issue-7916
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7916
TITLE: Query issue conversion error from string
NOTES:
[10.02.2024] pzotov
Confirmed bug on 6.0.0.250
Checked on 6.0.0.257.
"""
import pytest
from firebird.qa import *
db = db_factory()
test_script = """
recreate table session$test (sess_user char(63));
recreate table staff$test (staffid smallint, primary key (staffid) using index staff$test_staffid);
insert into session$test values ('TEST');
insert into session$test values ('1');
insert into staff$test values (1);
set list on;
-- set explain on;
select sess.sess_user, stf.staffid
from session$test sess
left join rdb$database rdb
on 1 = 1
left join staff$test stf
on trim(sess.sess_user) similar to '[0-9]+'
and stf.staffid = cast(trim(sess.sess_user) as smallint)
order by stf.staffid + 0
;
"""
act = isql_act('db', test_script, substitutions = [('[ \t]+', ' ')])
expected_stdout = """
SESS_USER TEST
STAFFID <null>
SESS_USER 1
STAFFID 1
"""
@pytest.mark.version('>=6.0')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute(combine_output = True)
assert act.clean_stdout == act.clean_expected_stdout