Skip to content

Commit 55c89db

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

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://www.usenix.org/system/files/osdi20-rigger.pdf
6+
TITLE: Partial index must not use incorrect assumption that 'c0 IS NOT 1' implied 'c0 NOT NULL'
7+
DESCRIPTION:
8+
https://www.usenix.org/system/files/osdi20-rigger.pdf
9+
page 3 listing 1
10+
NOTES:
11+
[05.06.2025] pzotov
12+
Support for partial indices in FB:
13+
https://github.com/FirebirdSQL/firebird/pull/7257
14+
"""
15+
16+
import pytest
17+
from firebird.qa import *
18+
19+
db = db_factory()
20+
21+
test_script = """
22+
set list on;
23+
recreate table t0 ( c0 int );
24+
create index i0 on t0 (c0) where c0 is not null;
25+
insert into t0 values (0);
26+
insert into t0 values (1);
27+
insert into t0 values (null);
28+
select c0 from t0 where c0 is distinct from 1;
29+
"""
30+
31+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
32+
33+
@pytest.mark.version('>=5.0')
34+
def test_1(act: Action):
35+
act.expected_stdout = """
36+
C0 0
37+
C0 <null>
38+
"""
39+
act.execute(combine_output = True)
40+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)