Skip to content

Commit 22dea34

Browse files
committed
Added/Updated tests\bugs\gh_7727_test.py: Checked on 5.0.0.1183, 4.0.4.2983 (intermediate snapshots).
1 parent 70d2e05 commit 22dea34

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

tests/bugs/gh_7727_test.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: issue-7727
5+
ISSUE: https://github.com/FirebirdSQL/firebird/issues/7727
6+
TITLE: Index for integer column cannot be used when INT128/DECFLOAT value is being searched
7+
DESCRIPTION:
8+
NOTES:
9+
[31.08.2023] pzotov
10+
Confirmed problem on 5.0.0.1177, 4.0.4.2979
11+
Checked on 5.0.0.1183, 4.0.4.2983 (intermediate snapshots).
12+
"""
13+
14+
import pytest
15+
from firebird.qa import *
16+
17+
db = db_factory()
18+
19+
test_script = f"""
20+
recreate table test_a (
21+
id bigint not null,
22+
constraint pk_test primary key(id)
23+
);
24+
25+
recreate table test_b (
26+
id bigint not null,
27+
constraint pk_test_b primary key(id)
28+
);
29+
30+
31+
set plan on;
32+
33+
select ta.id, tb.id
34+
from test_a ta
35+
left join test_b tb on tb.id = ta.id / cast(1000 as int128);
36+
37+
select ta.id, tb.id
38+
from test_a ta
39+
left join test_b tb on tb.id = ta.id / cast(1000 as decfloat);
40+
"""
41+
42+
act = isql_act('db', test_script)
43+
44+
expected_stdout = f"""
45+
PLAN JOIN (TA NATURAL, TB INDEX (PK_TEST_B))
46+
PLAN JOIN (TA NATURAL, TB INDEX (PK_TEST_B))
47+
"""
48+
49+
@pytest.mark.version('>=4.0.4')
50+
def test_1(act: Action):
51+
act.expected_stdout = expected_stdout
52+
act.execute(combine_output = True)
53+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)