Skip to content

Commit 35c3642

Browse files
committed
Added/Updated tests\functional\sqlancer\doi_10_1145_3428279_example_15_test.py: adapted from article provided in SQLancer documentation.
1 parent d62b198 commit 35c3642

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://dl.acm.org/doi/pdf/10.1145/3428279
6+
TITLE: Wrong evaluation of MIN when bitwise shift is applied to the source value
7+
DESCRIPTION:
8+
Manuel Rigger and Zhendong Su
9+
Finding Bugs in Database Systems via Query Partitioning
10+
https://dl.acm.org/doi/pdf/10.1145/3428279
11+
page 15 listing 15
12+
NOTES:
13+
"""
14+
15+
import pytest
16+
from firebird.qa import *
17+
18+
db = db_factory()
19+
20+
test_script = """
21+
set list on;
22+
recreate table t0 ( c0 int );
23+
insert into t0 values (-1) ;
24+
commit;
25+
select min(bin_shl(cast(c0 as bigint ),63)) as min_shl_63 from t0;
26+
select min(bin_shl(cast(c0 as int128 ), 127)) as min_shl_127 from t0;
27+
"""
28+
29+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
30+
31+
@pytest.mark.version('>=5.0')
32+
def test_1(act: Action):
33+
act.expected_stdout = """
34+
MIN_SHL_63 -9223372036854775808
35+
MIN_SHL_127 -170141183460469231731687303715884105728
36+
"""
37+
act.execute(combine_output = True)
38+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)