Skip to content

Commit 31823a1

Browse files
committed
Added/Updated tests\functional\sqlancer\osdi20_rigger_example_12_test.py: adapted from article provided in SQLancer documentation.
1 parent 5515051 commit 31823a1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://www.usenix.org/system/files/osdi20-rigger.pdf
6+
TITLE: Unexpected null value when index is used
7+
DESCRIPTION:
8+
https://www.usenix.org/system/files/osdi20-rigger.pdf
9+
page 11 listing 12
10+
NOTES:
11+
[05.06.2025] pzotov
12+
page_size = 32K is used in this test.
13+
"""
14+
15+
import pytest
16+
from firebird.qa import *
17+
18+
db = db_factory(page_size = 32768)
19+
20+
test_script = """
21+
set list on;
22+
recreate table t0 (c0 varchar(8183));
23+
insert into t0 (c0) values('b');
24+
insert into t0 (c0) values('a');
25+
26+
insert into t0 (c0) values (null);
27+
update t0 set c0 = 'a';
28+
commit;
29+
30+
create index i0 on t0 (c0);
31+
32+
set count on;
33+
select * from t0 where 'baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' > t0.c0 ; -- error : found unexpected null value in index " i0 "
34+
commit;
35+
"""
36+
37+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
38+
39+
@pytest.mark.version('>=4.0')
40+
def test_1(act: Action):
41+
act.expected_stdout = """
42+
C0 a
43+
C0 a
44+
C0 a
45+
Records affected: 3
46+
"""
47+
act.execute(combine_output = True)
48+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)