Skip to content

Commit a70e4e2

Browse files
committed
Added/Updated tests\functional\sqlancer\osdi20_rigger_example_04_test.py: adapted from article provided in SQLancer documentation.
1 parent 55c89db commit a70e4e2

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://www.usenix.org/system/files/osdi20-rigger.pdf
6+
TITLE: Incorrect result for DISTINCT.
7+
DESCRIPTION:
8+
https://www.usenix.org/system/files/osdi20-rigger.pdf
9+
page 10 listing 4
10+
11+
COULD NOT REPRODUCE PROPER (EXPECTED) REQULT. SOURCE QUERY SYNTAX SEEMS WEIRD!
12+
"""
13+
14+
import pytest
15+
from firebird.qa import *
16+
17+
db = db_factory()
18+
19+
test_script = """
20+
-- set list on;
21+
recreate table t0 (c0 int, c1 int, c2 int, c3 int /* generated by default as identity */, unique (c3 ,c2 ));
22+
insert into t0 ( c2 ) values(0);
23+
insert into t0 ( c2 ) values(0);
24+
insert into t0 ( c2 ) values(0);
25+
insert into t0 ( c2 ) values(0);
26+
insert into t0 ( c2 ) values(0);
27+
insert into t0 ( c2 ) values(0);
28+
insert into t0 ( c2 ) values(0);
29+
insert into t0 ( c2 ) values(0);
30+
insert into t0 ( c2 ) values(0);
31+
insert into t0 ( c2 ) values(0);
32+
insert into t0 ( c2 ) values(null);
33+
insert into t0 ( c2 ) values(1);
34+
insert into t0 ( c2 ) values(0);
35+
36+
update t0 set c1 = 0;
37+
insert into t0 ( c0 ) values (0);
38+
insert into t0 ( c0 ) values (0);
39+
insert into t0 ( c0 ) values (null);
40+
insert into t0 ( c0 ) values (0);
41+
42+
update t0 set c2 = 1;
43+
select distinct * from t0 where c2 = 1;
44+
45+
"""
46+
47+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
48+
49+
@pytest.mark.skip("Could not reproduce expected output. Source query syntax seems weird")
50+
@pytest.mark.version('>=3.0')
51+
def test_1(act: Action):
52+
act.expected_stdout = """
53+
"""
54+
act.execute(combine_output = True)
55+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)