File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ #coding:utf-8
2+
3+ """
4+ ID: issue-7916
5+ ISSUE: https://github.com/FirebirdSQL/firebird/issues/7916
6+ TITLE: Query issue conversion error from string
7+ NOTES:
8+ [10.02.2024] pzotov
9+ Confirmed bug on 6.0.0.250
10+ Checked on 6.0.0.257.
11+ """
12+
13+ import pytest
14+ from firebird .qa import *
15+
16+ db = db_factory ()
17+
18+ test_script = """
19+ recreate table session$test (sess_user char(63));
20+ recreate table staff$test (staffid smallint, primary key (staffid) using index staff$test_staffid);
21+
22+ insert into session$test values ('TEST');
23+ insert into session$test values ('1');
24+ insert into staff$test values (1);
25+
26+ set list on;
27+ -- set explain on;
28+
29+ select sess.sess_user, stf.staffid
30+ from session$test sess
31+ left join rdb$database rdb
32+ on 1 = 1
33+ left join staff$test stf
34+ on trim(sess.sess_user) similar to '[0-9]+'
35+ and stf.staffid = cast(trim(sess.sess_user) as smallint)
36+ order by stf.staffid + 0
37+ ;
38+ """
39+
40+ act = isql_act ('db' , test_script , substitutions = [('[ \t ]+' , ' ' )])
41+
42+ expected_stdout = """
43+ SESS_USER TEST
44+ STAFFID <null>
45+
46+ SESS_USER 1
47+ STAFFID 1
48+ """
49+
50+ @pytest .mark .version ('>=6.0' )
51+ def test_1 (act : Action ):
52+ act .expected_stdout = expected_stdout
53+ act .execute (combine_output = True )
54+ assert act .clean_stdout == act .clean_expected_stdout
You can’t perform that action at this time.
0 commit comments