Skip to content

Commit 76e2958

Browse files
committed
Added/Updated tests\functional\sqlancer\arch_2312_17510_example_02_test.py: adapted from article provided in SQLancer documentation.
1 parent dd698aa commit 76e2958

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://arxiv.org/pdf/2312.17510
6+
TITLE: Bug in RIGHT JOIN
7+
DESCRIPTION:
8+
https://arxiv.org/pdf/2312.17510 page #7 listing 2
9+
"""
10+
11+
import pytest
12+
from firebird.qa import *
13+
14+
db = db_factory()
15+
16+
test_script = """
17+
set list on;
18+
CREATE TABLE t1(a CHAR);
19+
CREATE TABLE t2(b CHAR);
20+
CREATE TABLE t3(c CHAR NOT NULL);
21+
CREATE TABLE t4(d CHAR);
22+
23+
INSERT INTO t2 VALUES('x');
24+
INSERT INTO t3 VALUES('y');
25+
26+
SELECT *
27+
FROM t4
28+
LEFT JOIN t3 ON TRUE
29+
INNER JOIN t1 ON t3.c=''
30+
RIGHT JOIN t2 ON t3.c=''
31+
WHERE t3.c IS NULL;
32+
33+
"""
34+
35+
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
36+
37+
@pytest.mark.version('>=3.0')
38+
def test_1(act: Action):
39+
act.expected_stdout = """
40+
D <null>
41+
C <null>
42+
A <null>
43+
B x
44+
"""
45+
act.execute(combine_output = True)
46+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)