Skip to content

Commit d62b198

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

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
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: n/a
5+
ISSUE: https://dl.acm.org/doi/pdf/10.1145/3428279
6+
TITLE: Non-deterministic output when using MAX() function
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 14 listing 11
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+
recreate table t1 ( c0 varchar(100) );
24+
insert into t1 values (0.9201898334673894);
25+
insert into t1 values (0);
26+
insert into t0 values (0);
27+
28+
select *
29+
from t0 cross join t1
30+
group by t0.c0, t1.c0
31+
having t1.c0 != max(t1.c0)
32+
33+
UNION ALL
34+
35+
select *
36+
from t0 cross join t1
37+
group by t0.c0, t1.c0
38+
having not t1.c0 > max (t1.c0)
39+
;
40+
"""
41+
42+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
43+
44+
@pytest.mark.version('>=3.0')
45+
def test_1(act: Action):
46+
act.expected_stdout = """
47+
C0 0
48+
C0 0
49+
C0 0
50+
C0 0.9201898334673894
51+
"""
52+
act.execute(combine_output = True)
53+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)